Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
For some reason saving a file with just a newline simply becomes completely empty (guess it is kinda redundant)
  • Loading branch information
Moosems committed Oct 18, 2024
1 parent fff2d2a commit 2ad8ab2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_trailing_newline_plugin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
def test_trailing_newline(filetab, tmp_path):
filetab.path = tmp_path / "foo.py"

assert filetab.textwidget.get("1.0", "end ") == "\n"
filetab.save()
assert (tmp_path / "foo.py").read_text() == "\n"
assert filetab.textwidget.get("1.0", "end ") == "\n"
assert (tmp_path / "foo.py").read_text() == ""

filetab.textwidget.insert("1.0", "hello")
assert filetab.textwidget.get("1.0", "end - 1 char") == "hello"
Expand Down

0 comments on commit 2ad8ab2

Please sign in to comment.