Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann committed Mar 30, 2024
1 parent 550d591 commit 28da292
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_single_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,3 +398,23 @@ def test_will_save_wait_until(self) -> 'Generator':
text = self.view.substr(sublime.Region(0, self.view.size()))
self.assertEquals("BBB", text)
yield from self.await_clear_view_and_save()


class AnotherDocumentTestCase(TextDocumentTestCase):

@classmethod
def get_test_name(cls) -> str:
return "testfile2"

def test_did_change_before_did_close(self) -> 'Generator':
assert self.view
self.view.window().run_command("chain", {
"commands": [
["insert", {"characters": "TEST"}],
["save", {"async": False}],
["close", {}]
]
})
yield from self.await_message('textDocument/didChange')
# yield from self.await_message('textDocument/didSave') # TODO why is this not sent?
yield from self.await_message('textDocument/didClose')
Empty file added tests/testfile2.txt
Empty file.

0 comments on commit 28da292

Please sign in to comment.