Handle backspace across wrapped lines (closes #59)

This commit is contained in:
Fredrik Fornwall
2016-03-07 23:45:02 +01:00
parent 46c9c4b80e
commit ca71265f23
3 changed files with 23 additions and 2 deletions

View File

@@ -218,4 +218,13 @@ public class CursorAndScreenTest extends TerminalTestCase {
" -");
}
public void testBackspaceAcrossWrappedLines() {
// Backspace should not go to previous line if not auto-wrapped:
withTerminalSized(3, 3).enterString("hi\r\n\b\byou").assertLinesAre("hi ", "you", " ");
// Backspace should go to previous line if auto-wrapped:
withTerminalSized(3, 3).enterString("hi y").assertLinesAre("hi ", "y ", " ").enterString("\b\b#").assertLinesAre("hi#", "y ", " ");
// Initial backspace should do nothing:
withTerminalSized(3, 3).enterString("\b\b\b\bhi").assertLinesAre("hi ", " ", " ");
}
}