summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-02-24 23:54:13 +0100
committerhut <hut@lavabit.com>2010-02-24 23:54:17 +0100
commitdc437e3b564df67db5cd27aeb7465625f7d875a9 (patch)
tree4e0efea43b452e137eb2b91eeed9a5018fdbd433
parentd906b0dd2d09ea5e4619dd644e281c1ec66779b5 (diff)
downloadranger-dc437e3b564df67db5cd27aeb7465625f7d875a9.tar.gz
shell_escape: added testcase
-rw-r--r--test/tc_ext.py7
1 files changed, 7 insertions, 0 deletions
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()
> 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167