summary refs log tree commit diff stats
path: root/test
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 /test
parentd906b0dd2d09ea5e4619dd644e281c1ec66779b5 (diff)
downloadranger-dc437e3b564df67db5cd27aeb7465625f7d875a9.tar.gz
shell_escape: added testcase
Diffstat (limited to 'test')
-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()
rtik Agaram <vc@akkartik.com> 2018-12-29 15:27:18 -0800 committer Kartik Agaram <vc@akkartik.com> 2018-12-29 15:27:18 -0800 4890 - new html renderings' href='/akkartik/mu/commit/html/051scenario_test.mu.html?h=hlt&id=ac07e589b3e912c704c2011d543f18b16712ff15'>ac07e589 ^
08a0eed6 ^
e4ac3c9e ^
c762564b ^
ac07e589 ^



672e3e50 ^

a654e4ec ^



e5c11a51 ^






















a654e4ec ^

672e3e50 ^
e5c11a51 ^
e4ac3c9e ^
a654e4ec ^
204dae92 ^



805d58c6 ^
204dae92 ^

805d58c6 ^
204dae92 ^




805d58c6 ^

204dae92 ^

805d58c6 ^
204dae92 ^




805d58c6 ^


204dae92 ^

805d58c6 ^
204dae92 ^




805d58c6 ^



204dae92 ^

805d58c6 ^
204dae92 ^




805d58c6 ^
204dae92 ^

805d58c6 ^
204dae92 ^




805d58c6 ^
204dae92 ^

805d58c6 ^
204dae92 ^




805d58c6 ^
204dae92 ^

805d58c6 ^
204dae92 ^

672e3e50 ^


a654e4ec ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130