From f4c6046a736020eb3637eb9943e0fbba5b68f2c0 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Fri, 14 Feb 2014 09:35:48 +0100 Subject: [PATCH] Fixed remaining test for python3 and added a shell code test using umlauts. --- pythonx/UltiSnips/text_objects/_shell_code.py | 3 ++- test.py | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pythonx/UltiSnips/text_objects/_shell_code.py b/pythonx/UltiSnips/text_objects/_shell_code.py index 3ed72c3..3e9099a 100755 --- a/pythonx/UltiSnips/text_objects/_shell_code.py +++ b/pythonx/UltiSnips/text_objects/_shell_code.py @@ -9,6 +9,7 @@ from subprocess import Popen, PIPE import stat import tempfile +from UltiSnips.compatibility import as_unicode from UltiSnips.text_objects._base import NoneditableTextObject def _chomp(string): @@ -38,7 +39,7 @@ def _run_shell_command(cmd, tmpdir): proc.wait() stdout, _ = proc.communicate() os.unlink(path) - return _chomp(stdout.encode('utf-8')) + return _chomp(as_unicode(stdout)) def _get_tmp(): """Find an executable tmp directory.""" diff --git a/test.py b/test.py index cbfdc06..736db76 100755 --- a/test.py +++ b/test.py @@ -221,8 +221,6 @@ class _VimTest(unittest.TestCase): output = None skip_on_windows = False - skip_on_linux = False - skip_on_mac = False def send(self,s): self.vim.send(s) @@ -274,10 +272,6 @@ class _VimTest(unittest.TestCase): system = platform.system() if self.skip_on_windows and system == "Windows": return self._skip("Running on windows") - if self.skip_on_linux and system == "Linux": - return self._skip("Running on Linux") - if self.skip_on_mac and system == "Darwin": - return self._skip("Running on Darwin/Mac") # Escape for good measure self.send(ESC + ESC + ESC) @@ -860,6 +854,11 @@ class TabStop_Shell_SimpleExample(_VimTest): snippets = ("test", "hi `echo hallo` you!") keys = "test" + EX + "and more" wanted = "hi hallo you!and more" +class TabStop_Shell_WithUmlauts(_VimTest): + skip_on_windows = True + snippets = ("test", "hi `echo höüäh` you!") + keys = "test" + EX + "and more" + wanted = "hi höüäh you!and more" class TabStop_Shell_TextInNextLine(_VimTest): skip_on_windows = True snippets = ("test", "hi `echo hallo`\nWeiter")