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