equal
deleted
inserted
replaced
52 r"""test matching like running on windows |
52 r"""test matching like running on windows |
53 |
53 |
54 enable windows matching on any os |
54 enable windows matching on any os |
55 >>> _osaltsep = os.altsep |
55 >>> _osaltsep = os.altsep |
56 >>> os.altsep = True |
56 >>> os.altsep = True |
|
57 >>> _osname = os.name |
|
58 >>> os.name = 'nt' |
57 |
59 |
58 valid match on windows |
60 valid match on windows |
59 >>> lm(b'g/a*/d (glob)\n', b'g\\abc/d\n') |
61 >>> lm(b'g/a*/d (glob)\n', b'g\\abc/d\n') |
60 True |
62 True |
61 |
63 |
64 'special: -glob' |
66 'special: -glob' |
65 |
67 |
66 missing glob |
68 missing glob |
67 >>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d/fg\n') |
69 >>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d/fg\n') |
68 'special: +glob' |
70 'special: +glob' |
|
71 >>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d\\fg\r\n') |
|
72 'special: +glob' |
69 |
73 |
70 restore os.altsep |
74 restore os.altsep |
71 >>> os.altsep = _osaltsep |
75 >>> os.altsep = _osaltsep |
|
76 >>> os.name = _osname |
72 """ |
77 """ |
73 pass |
78 pass |
74 |
79 |
75 def otherostests(): |
80 def otherostests(): |
76 r"""test matching like running on non-windows os |
81 r"""test matching like running on non-windows os |
77 |
82 |
78 disable windows matching on any os |
83 disable windows matching on any os |
79 >>> _osaltsep = os.altsep |
84 >>> _osaltsep = os.altsep |
80 >>> os.altsep = False |
85 >>> os.altsep = False |
|
86 >>> _osname = os.name |
|
87 >>> os.name = 'nt' |
81 |
88 |
82 backslash does not match slash |
89 backslash does not match slash |
83 >>> lm(b'h/a* (glob)\n', b'h\\ab\n') |
90 >>> lm(b'h/a* (glob)\n', b'h\\ab\n') |
84 False |
91 False |
85 |
92 |
91 >>> lm(b'/h/c/df/g/\n', b'\\h/c\\df/g\\\n') |
98 >>> lm(b'/h/c/df/g/\n', b'\\h/c\\df/g\\\n') |
92 False |
99 False |
93 |
100 |
94 restore os.altsep |
101 restore os.altsep |
95 >>> os.altsep = _osaltsep |
102 >>> os.altsep = _osaltsep |
|
103 >>> os.name = _osname |
96 """ |
104 """ |
97 pass |
105 pass |
98 |
106 |
99 if __name__ == '__main__': |
107 if __name__ == '__main__': |
100 doctest.testmod() |
108 doctest.testmod() |