Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardroche committed Feb 13, 2020
1 parent dc41a3c commit db7739b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -47,7 +47,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
### Fixed

* Fixed [#687](https://github.com/NeoVintageous/NeoVintageous/issues/687): Various `:!{cmd}` inconsistencies
* Fixed [#683](https://github.com/NeoVintageous/NeoVintageous/issues/683): `'{a-z]` in visual line mode is inconsistent
* Fixed [#683](https://github.com/NeoVintageous/NeoVintageous/issues/683): `'{a-z}` in visual line mode is inconsistent
* Fixed [#682](https://github.com/NeoVintageous/NeoVintageous/issues/682): Visual mode `m{a-z}` off-by-one
* Fixed [#681](https://github.com/NeoVintageous/NeoVintageous/issues/681): `m{a-z}` should not change mode
* Fixed [#680](https://github.com/NeoVintageous/NeoVintageous/issues/680): `{backtick}{a-z}` should position cursor at the specified location
Expand Down
5 changes: 4 additions & 1 deletion tests/functional/test__ex_read.py
Expand Up @@ -35,4 +35,7 @@ def test_read_cmd(self):
def test_read_cmd_error(self):
self.normal('f|izz\nxxx\n')
self.feed(':read !ls foo_test_read_cmd_error')
self.assertNormal('fizz\n|ls: cannot access \'foo_test_read_cmd_error\': No such file or directory\nxxx\n')
if self.platform() == 'osx':
self.assertNormal('fizz\n|ls: foo_test_read_cmd_error: No such file or directory\nxxx\n')
else:
self.assertNormal('fizz\n|ls: cannot access \'foo_test_read_cmd_error\': No such file or directory\nxxx\n')
5 changes: 4 additions & 1 deletion tests/functional/test__ex_shell_out.py
Expand Up @@ -125,7 +125,10 @@ def test_error(self):
def test_replacement_error(self):
self.normal('fizz\nx|xx\nbuzz\n')
self.feed(':.!ls foo_test_replacement_error')
self.assertNormal('fizz\n|ls: cannot access \'foo_test_replacement_error\': No such file or directory\nbuzz\n')
if self.platform() == 'osx':
self.assertNormal('fizz\n|ls: foo_test_replacement_error: No such file or directory\nbuzz\n')
else:
self.assertNormal('fizz\n|ls: cannot access \'foo_test_replacement_error\': No such file or directory\nbuzz\n') # noqa: E501

@unittest.mock_status_message()
def test_empty_file_name_replacement_emits_status_message(self):
Expand Down
4 changes: 4 additions & 0 deletions tests/unittest.py
Expand Up @@ -27,6 +27,7 @@
# Use aliases to indicate that they are not public testing APIs.
from sublime import Region
from sublime import active_window as _active_window
from sublime import platform as _platform
from sublime import version as _version

# Use aliases to indicate that they are not public testing APIs.
Expand Down Expand Up @@ -82,6 +83,9 @@ def tearDown(self):
self.view.set_scratch(True)
self.view.close()

def platform(self):
return _platform()

def content(self) -> str:
return self.view.substr(Region(0, self.view.size()))

Expand Down

0 comments on commit db7739b

Please sign in to comment.