From dc437e3b564df67db5cd27aeb7465625f7d875a9 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 24 Feb 2010 23:54:13 +0100 Subject: shell_escape: added testcase --- test/tc_ext.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/tc_ext.py b/test/tc_ext.py index c57d4aa8..37139be2 100644 --- a/test/tc_ext.py +++ b/test/tc_ext.py @@ -118,6 +118,13 @@ class TestCases(unittest.TestCase): setattr(os, attr_name, value2) self.assertEqual(value2, getattr(os, attr_name)) + def test_shell_escape(self): + from ranger.ext.shell_escape import shell_escape, shell_quote + self.assertEqual(r"'luigi'\''s pizza'", shell_quote("luigi's pizza")) + self.assertEqual(r"luigi\'s\ pizza", shell_escape("luigi's pizza")) + self.assertEqual(r"\$lol/foo\\xyz\|\>\<\]\[", + shell_escape(r"$lol/foo\xyz|><][")) + if __name__ == '__main__': unittest.main() -- cgit 1.4.1-2-gfad0