Show More
@@ -37,37 +37,37 b' def greedy_completion():' | |||
|
37 | 37 | |
|
38 | 38 | def test_protect_filename(): |
|
39 | 39 | if sys.platform == 'win32': |
|
40 |
pairs = [ |
|
|
41 |
(' abc',"' |
|
|
42 |
('a bc',"' |
|
|
43 |
('a bc',"' |
|
|
44 |
(' bc',"' |
|
|
45 | ] | |
|
40 | pairs = [('abc','abc'), | |
|
41 | (' abc','" abc"'), | |
|
42 | ('a bc','"a bc"'), | |
|
43 | ('a bc','"a bc"'), | |
|
44 | (' bc','" bc"'), | |
|
45 | ] | |
|
46 | 46 | else: |
|
47 |
pairs = [ |
|
|
48 | (' abc',r'\ abc'), | |
|
49 | ('a bc',r'a\ bc'), | |
|
50 | ('a bc',r'a\ \ bc'), | |
|
51 | (' bc',r'\ \ bc'), | |
|
52 | # On posix, we also protect parens and other special characters | |
|
53 | ('a(bc',r'a\(bc'), | |
|
54 | ('a)bc',r'a\)bc'), | |
|
55 | ('a( )bc',r'a\(\ \)bc'), | |
|
56 | ('a[1]bc', r'a\[1\]bc'), | |
|
57 | ('a{1}bc', r'a\{1\}bc'), | |
|
58 | ('a#bc', r'a\#bc'), | |
|
59 | ('a?bc', r'a\?bc'), | |
|
60 | ('a=bc', r'a\=bc'), | |
|
61 | ('a\\bc', r'a\\bc'), | |
|
62 | ('a|bc', r'a\|bc'), | |
|
63 | ('a;bc', r'a\;bc'), | |
|
64 | ('a:bc', r'a\:bc'), | |
|
65 | ("a'bc", r"a\'bc"), | |
|
66 | ('a*bc', r'a\*bc'), | |
|
67 | ('a"bc', r'a\"bc'), | |
|
68 | ('a^bc', r'a\^bc'), | |
|
69 | ('a&bc', r'a\&bc'), | |
|
70 | ] | |
|
47 | pairs = [('abc','abc'), | |
|
48 | (' abc',r'\ abc'), | |
|
49 | ('a bc',r'a\ bc'), | |
|
50 | ('a bc',r'a\ \ bc'), | |
|
51 | (' bc',r'\ \ bc'), | |
|
52 | # On posix, we also protect parens and other special characters. | |
|
53 | ('a(bc',r'a\(bc'), | |
|
54 | ('a)bc',r'a\)bc'), | |
|
55 | ('a( )bc',r'a\(\ \)bc'), | |
|
56 | ('a[1]bc', r'a\[1\]bc'), | |
|
57 | ('a{1}bc', r'a\{1\}bc'), | |
|
58 | ('a#bc', r'a\#bc'), | |
|
59 | ('a?bc', r'a\?bc'), | |
|
60 | ('a=bc', r'a\=bc'), | |
|
61 | ('a\\bc', r'a\\bc'), | |
|
62 | ('a|bc', r'a\|bc'), | |
|
63 | ('a;bc', r'a\;bc'), | |
|
64 | ('a:bc', r'a\:bc'), | |
|
65 | ("a'bc", r"a\'bc"), | |
|
66 | ('a*bc', r'a\*bc'), | |
|
67 | ('a"bc', r'a\"bc'), | |
|
68 | ('a^bc', r'a\^bc'), | |
|
69 | ('a&bc', r'a\&bc'), | |
|
70 | ] | |
|
71 | 71 | # run the actual tests |
|
72 | 72 | for s1, s2 in pairs: |
|
73 | 73 | s1p = completer.protect_filename(s1) |
General Comments 0
You need to be logged in to leave comments.
Login now