public TestDriver assertDel(int times) { while (times-- > 0) { assertDel(); } return this; }
public void testDeletePrevChar() { console.init(); console.on(KeyStrokes.DELETE_PREV_CHAR); driver.assertEmpty(); console.on(KeyStrokes.a); driver.assertChar('a').assertFlush().assertEmpty(); console.on(KeyStrokes.DELETE_PREV_CHAR); driver.assertDel().assertFlush().assertEmpty(); }
driver.assertChar('c').assertFlush().assertEmpty(); console.on(KeyStrokes.UP); driver.assertDel().assertChar('b').assertFlush().assertEmpty(); console.on(KeyStrokes.UNDERSCORE); driver.assertChar('_').assertFlush().assertEmpty(); console.on(KeyStrokes.UP); driver.assertDel().assertDel().assertChar('a').assertFlush().assertEmpty(); console.on(KeyStrokes.UP); driver.assertEmpty(); console.on(KeyStrokes.DOWN); driver.assertDel().assertChar('b').assertChar('_').assertFlush().assertEmpty(); console.on(KeyStrokes.DOWN); driver.assertDel().assertDel().assertChar('c').assertFlush().assertEmpty(); console.on(KeyStrokes.DOWN); driver.assertEmpty(); console.on(KeyStrokes.UP); driver.assertDel().assertChar('b').assertChar('_').assertFlush().assertEmpty(); console.on(KeyStrokes.ONE); driver.assertChar('1').assertFlush().assertEmpty(); driver.assertChar('b').assertChar('_').assertChar('1').assertFlush().assertEmpty(); console.on(KeyStrokes.UP); driver.assertDel().assertDel().assertDel().assertChar('b').assertChar('_').assertFlush().assertEmpty(); console.on(KeyStrokes.UP); driver.assertDel().assertDel().assertChar('a').assertFlush().assertEmpty();
public void testDeleteEnd() { console.init(); console.on(KeyStrokes.DELETE_END); driver.assertEmpty(); assertEquals("", getClipboard()); console.on(KeyStrokes.a); console.on(KeyStrokes.b); console.on(KeyStrokes.c); driver.assertChar('a').assertFlush(); driver.assertChar('b').assertFlush(); driver.assertChar('c').assertFlush().assertEmpty(); console.on(KeyStrokes.LEFT); driver.assertMoveLeft().assertFlush().assertEmpty(); console.on(KeyStrokes.LEFT); driver.assertMoveLeft().assertFlush().assertEmpty(); console.on(KeyStrokes.DELETE_END); driver.assertMoveRight().assertMoveRight().assertDel().assertDel().assertFlush().assertEmpty(); assertEquals("a", getCurrentLine()); assertEquals("bc", getClipboard()); }
public void testDeleteNextChar() { console.init(); console.on(KeyStrokes.DELETE_NEXT_CHAR); driver.assertEmpty(); console.on(KeyStrokes.a); console.on(KeyStrokes.b); driver.assertChar('a').assertFlush(); driver.assertChar('b').assertFlush().assertEmpty(); console.on(KeyStrokes.DELETE_NEXT_CHAR); driver.assertEmpty(); console.on(KeyStrokes.LEFT); driver.assertMoveLeft().assertFlush().assertEmpty(); console.on(KeyStrokes.LEFT); driver.assertMoveLeft().assertFlush().assertEmpty(); console.on(KeyStrokes.DELETE_NEXT_CHAR); driver.assertMoveRight().assertMoveLeft().assertChar('b').assertChar(' ').assertMoveLeft().assertMoveLeft().assertFlush().assertEmpty(); assertEquals("b", getCurrentLine()); console.on(KeyStrokes.DELETE_NEXT_CHAR); driver.assertMoveRight().assertDel().assertFlush().assertEmpty(); assertEquals("", getCurrentLine()); }