Code example for LineNumberInputStream

Methods: getLineNumbersetLineNumber

0
            // Expected. 
        } 
    } 
 
    public void test_setLineNumberI() { 
        lnis.setLineNumber(42);
        assertEquals("Test 1: Failed to set line number;",
                42, lnis.getLineNumber());
        // Repeat the test with a different number to make sure that the 
        // line number is really set. 
        lnis.setLineNumber(89);
        assertEquals("Test 2: Failed to set line number;",
                89, lnis.getLineNumber());
    } 
 
    public void test_skipJ() throws IOException { 
        long skipped = lnis.skip(4);
        assertEquals("Test 1: Incorrect number of characters skipped;",
                4, skipped);
        assertEquals("Test 2: Skip failed to increment line number;",
Experience pair programming with AI  Get Codota for Java