Skip to content

Commit

Permalink
an attempt to fix that test
Browse files Browse the repository at this point in the history
  • Loading branch information
qexat committed Sep 30, 2023
1 parent 7182724 commit 3feb93a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/features/movement_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def test_sequence_handling(run_only_fake):
h.press('\x1b[1;')
h.press(' test7')
h.await_text('test1 test2 test3 test4 test5 test6 test7')
h.await_text(r'\x1b[1;')
h.await_text(r'\x1b(263)')


def test_indentation_using_tabs(run, tmpdir):
Expand Down
25 changes: 25 additions & 0 deletions tests/features/text_editing_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,31 @@ def test_backword_joins_lines(run, tmpdir):
h.await_cursor_position(x=3, y=2)


def test_backword_at_end_of_file_still_allows_scrolling_down(run, tmpdir):
f = tmpdir.join('f')
f.write('hello world')

with run(str(f)) as h, and_exit(h):
h.await_text('hello world')
h.press('Down')
h.press('M-BSpace')
h.press('Down')
h.await_cursor_position(x=0, y=2)
h.await_text_missing('*')


def test_backword_deletes_newline_at_end_of_file(run, tmpdir):
f = tmpdir.join('f')
f.write('foo\n\n')

with run(str(f)) as h, and_exit(h):
h.press('^End')
h.press('M-BSpace')
h.press('^S')

assert f.read() == 'foo\n'


def test_backword_deletes_text(run, tmpdir):
f = tmpdir.join('f')
f.write('ohai there')
Expand Down

0 comments on commit 3feb93a

Please sign in to comment.