assertTrue(boundary.isEnd());
assertFalse(cursor.isReady());
}
public void testDribble() throws Exception {
DribbleCursor cursor = new DribbleCursor(new StreamCursor(new ByteArrayInputStream(TERMINAL)), 3);
while(!boundary.isFinished()) {
boundary.consume(cursor);
}
assertEquals(cursor.read(), 'X');
assertEquals(cursor.read(), 'Y');
assertTrue(boundary.isFinished());
assertTrue(boundary.isEnd());
assertFalse(cursor.isReady());
boundary.clear();
cursor = new DribbleCursor(new StreamCursor(new ByteArrayInputStream(TERMINAL)), 1);
while(!boundary.isFinished()) {
boundary.consume(cursor);
}
assertEquals(cursor.read(), 'X');