~bzr-pqm/bzr/bzr.dev

4763.2.4 by John Arbash Meinel
merge bzr.2.1 in preparation for NEWS entry.
1
# Copyright (C) 2007-2010 Canonical Ltd
2617.5.1 by Kuno Meyer
Added direct unit tests for win32utils.glob_expand().
2
#
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
4183.7.1 by Sabin Iacob
update FSF mailing address
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2617.5.1 by Kuno Meyer
Added direct unit tests for win32utils.glob_expand().
16
2681.4.2 by Alexander Belchenko
test for get_app_path
17
import os
2617.5.4 by Kuno Meyer
Included feedback on initial patch.
18
import sys
19
4786.1.1 by John Arbash Meinel
Work on doing globbing, etc for all commands on Windows.
20
from bzrlib import (
21
    osutils,
22
    tests,
23
    win32utils,
24
    )
4505.2.4 by Alexander Belchenko
guard tests with UnicodeFilenameFeature.
25
from bzrlib.tests import (
26
    Feature,
27
    TestCase,
28
    TestCaseInTempDir,
29
    TestSkipped,
30
    UnicodeFilenameFeature,
31
    )
2681.4.2 by Alexander Belchenko
test for get_app_path
32
from bzrlib.win32utils import glob_expand, get_app_path
2617.5.4 by Kuno Meyer
Included feedback on initial patch.
33
34
4789.20.3 by John Arbash Meinel
Use the right case sensitivity feature (cicp, not just ci).
35
class _BackslashDirSeparatorFeature(tests.Feature):
36
37
    def _probe(self):
38
        try:
39
            os.lstat(os.getcwd() + '\\')
40
        except OSError:
41
            return False
42
        else:
43
            return True
44
45
    def feature_name(self):
46
        return "Filesystem treats '\\' as a directory separator."
47
48
BackslashDirSeparatorFeature = _BackslashDirSeparatorFeature()
49
2617.5.4 by Kuno Meyer
Included feedback on initial patch.
50
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
51
class _RequiredModuleFeature(Feature):
52
53
    def __init__(self, mod_name):
54
        self.mod_name = mod_name
55
        super(_RequiredModuleFeature, self).__init__()
2681.4.4 by Alexander Belchenko
test use Feature instead of TestSkipped
56
57
    def _probe(self):
58
        try:
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
59
            __import__(self.mod_name)
2681.4.4 by Alexander Belchenko
test use Feature instead of TestSkipped
60
            return True
61
        except ImportError:
62
            return False
63
64
    def feature_name(self):
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
65
        return self.mod_name
2681.4.4 by Alexander Belchenko
test use Feature instead of TestSkipped
66
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
67
Win32RegistryFeature = _RequiredModuleFeature('_winreg')
68
CtypesFeature = _RequiredModuleFeature('ctypes')
69
Win32comShellFeature = _RequiredModuleFeature('win32com.shell')
2681.4.4 by Alexander Belchenko
test use Feature instead of TestSkipped
70
71
2617.5.4 by Kuno Meyer
Included feedback on initial patch.
72
# Tests
73
# -----
2617.5.6 by Kuno Meyer
Incorporated feedback from the mailinglist.
74
2617.5.4 by Kuno Meyer
Included feedback on initial patch.
75
class TestWin32UtilsGlobExpand(TestCaseInTempDir):
2617.5.2 by Kuno Meyer
just reformatting
76
4789.20.1 by John Arbash Meinel
Updates to tests that were exercising filesystem globbing.
77
    _test_needs_features = []
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
78
2617.5.1 by Kuno Meyer
Added direct unit tests for win32utils.glob_expand().
79
    def test_empty_tree(self):
80
        self.build_tree([])
2617.5.2 by Kuno Meyer
just reformatting
81
        self._run_testset([
82
            [['a'], ['a']],
83
            [['?'], ['?']],
84
            [['*'], ['*']],
85
            [['a', 'a'], ['a', 'a']]])
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
86
4789.20.2 by John Arbash Meinel
Split the win32 globbing tests up a bit.
87
    def build_ascii_tree(self):
2617.5.1 by Kuno Meyer
Added direct unit tests for win32utils.glob_expand().
88
        self.build_tree(['a', 'a1', 'a2', 'a11', 'a.1',
89
                         'b', 'b1', 'b2', 'b3',
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
90
                         'c/', 'c/c1', 'c/c2',
2617.5.4 by Kuno Meyer
Included feedback on initial patch.
91
                         'd/', 'd/d1', 'd/d2', 'd/e/', 'd/e/e1'])
4789.20.2 by John Arbash Meinel
Split the win32 globbing tests up a bit.
92
93
    def build_unicode_tree(self):
94
        self.requireFeature(UnicodeFilenameFeature)
95
        self.build_tree([u'\u1234', u'\u1234\u1234', u'\u1235/',
96
                         u'\u1235/\u1235'])
97
98
    def test_tree_ascii(self):
99
        """Checks the glob expansion and path separation char
100
        normalization"""
101
        self.build_ascii_tree()
2617.5.2 by Kuno Meyer
just reformatting
102
        self._run_testset([
103
            # no wildcards
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
104
            [[u'a'], [u'a']],
105
            [[u'a', u'a' ], [u'a', u'a']],
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
106
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
107
            [[u'd'], [u'd']],
108
            [[u'd/'], [u'd/']],
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
109
2617.5.2 by Kuno Meyer
just reformatting
110
            # wildcards
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
111
            [[u'a*'], [u'a', u'a1', u'a2', u'a11', u'a.1']],
112
            [[u'?'], [u'a', u'b', u'c', u'd']],
113
            [[u'a?'], [u'a1', u'a2']],
114
            [[u'a??'], [u'a11', u'a.1']],
115
            [[u'b[1-2]'], [u'b1', u'b2']],
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
116
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
117
            [[u'd/*'], [u'd/d1', u'd/d2', u'd/e']],
4789.20.2 by John Arbash Meinel
Split the win32 globbing tests up a bit.
118
            [[u'?/*'], [u'c/c1', u'c/c2', u'd/d1', u'd/d2', u'd/e']],
119
            [[u'*/*'], [u'c/c1', u'c/c2', u'd/d1', u'd/d2', u'd/e']],
120
            [[u'*/'], [u'c/', u'd/']],
121
            ])
122
123
    def test_backslash_globbing(self):
4789.20.3 by John Arbash Meinel
Use the right case sensitivity feature (cicp, not just ci).
124
        self.requireFeature(BackslashDirSeparatorFeature)
4789.20.2 by John Arbash Meinel
Split the win32 globbing tests up a bit.
125
        self.build_ascii_tree()
126
        self._run_testset([
127
            [[u'd\\'], [u'd/']],
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
128
            [[u'd\\*'], [u'd/d1', u'd/d2', u'd/e']],
129
            [[u'?\\*'], [u'c/c1', u'c/c2', u'd/d1', u'd/d2', u'd/e']],
130
            [[u'*\\*'], [u'c/c1', u'c/c2', u'd/d1', u'd/d2', u'd/e']],
4789.20.2 by John Arbash Meinel
Split the win32 globbing tests up a bit.
131
            [[u'*\\'], [u'c/', u'd/']],
132
            ])
133
134
    def test_case_insensitive_globbing(self):
4789.20.3 by John Arbash Meinel
Use the right case sensitivity feature (cicp, not just ci).
135
        self.requireFeature(tests.CaseInsCasePresFilenameFeature)
4789.20.2 by John Arbash Meinel
Split the win32 globbing tests up a bit.
136
        self.build_ascii_tree()
137
        self._run_testset([
138
            [[u'A'], [u'A']],
139
            [[u'A?'], [u'a1', u'a2']],
140
            ])
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
141
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
142
    def test_tree_unicode(self):
2617.5.7 by Kuno Meyer
Fix for non-ASCII filenames
143
        """Checks behaviour with non-ascii filenames"""
4789.20.2 by John Arbash Meinel
Split the win32 globbing tests up a bit.
144
        self.build_unicode_tree()
2617.5.7 by Kuno Meyer
Fix for non-ASCII filenames
145
        self._run_testset([
146
            # no wildcards
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
147
            [[u'\u1234'], [u'\u1234']],
148
            [[u'\u1235'], [u'\u1235']],
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
149
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
150
            [[u'\u1235/'], [u'\u1235/']],
151
            [[u'\u1235/\u1235'], [u'\u1235/\u1235']],
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
152
2617.5.7 by Kuno Meyer
Fix for non-ASCII filenames
153
            # wildcards
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
154
            [[u'?'], [u'\u1234', u'\u1235']],
155
            [[u'*'], [u'\u1234', u'\u1234\u1234', u'\u1235']],
156
            [[u'\u1234*'], [u'\u1234', u'\u1234\u1234']],
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
157
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
158
            [[u'\u1235/?'], [u'\u1235/\u1235']],
159
            [[u'\u1235/*'], [u'\u1235/\u1235']],
4789.20.2 by John Arbash Meinel
Split the win32 globbing tests up a bit.
160
            [[u'?/'], [u'\u1235/']],
161
            [[u'*/'], [u'\u1235/']],
162
            [[u'?/?'], [u'\u1235/\u1235']],
163
            [[u'*/*'], [u'\u1235/\u1235']],
164
            ])
165
166
    def test_unicode_backslashes(self):
4789.20.3 by John Arbash Meinel
Use the right case sensitivity feature (cicp, not just ci).
167
        self.requireFeature(BackslashDirSeparatorFeature)
4789.20.2 by John Arbash Meinel
Split the win32 globbing tests up a bit.
168
        self.build_unicode_tree()
169
        self._run_testset([
170
            # no wildcards
4789.20.3 by John Arbash Meinel
Use the right case sensitivity feature (cicp, not just ci).
171
            [[u'\u1235\\'], [u'\u1235/']],
172
            [[u'\u1235\\\u1235'], [u'\u1235/\u1235']],
2617.5.8 by Kuno Meyer
Extended tests for unicode chars outside of the iso-8859-* range
173
            [[u'\u1235\\?'], [u'\u1235/\u1235']],
174
            [[u'\u1235\\*'], [u'\u1235/\u1235']],
175
            [[u'?\\'], [u'\u1235/']],
176
            [[u'*\\'], [u'\u1235/']],
177
            [[u'?\\?'], [u'\u1235/\u1235']],
4789.20.2 by John Arbash Meinel
Split the win32 globbing tests up a bit.
178
            [[u'*\\*'], [u'\u1235/\u1235']],
179
            ])
2617.5.7 by Kuno Meyer
Fix for non-ASCII filenames
180
2617.5.1 by Kuno Meyer
Added direct unit tests for win32utils.glob_expand().
181
    def _run_testset(self, testset):
182
        for pattern, expected in testset:
183
            result = glob_expand(pattern)
184
            expected.sort()
185
            result.sort()
186
            self.assertEqual(expected, result, 'pattern %s' % pattern)
2617.5.2 by Kuno Meyer
just reformatting
187
2681.4.2 by Alexander Belchenko
test for get_app_path
188
189
class TestAppPaths(TestCase):
190
2681.4.4 by Alexander Belchenko
test use Feature instead of TestSkipped
191
    _test_needs_features = [Win32RegistryFeature]
192
2681.4.2 by Alexander Belchenko
test for get_app_path
193
    def test_iexplore(self):
194
        # typical windows users should have IE installed
195
        for a in ('iexplore', 'iexplore.exe'):
196
            p = get_app_path(a)
197
            d, b = os.path.split(p)
3146.4.9 by Aaron Bentley
do case-insensitive comparision of iexplore filename
198
            self.assertEquals('iexplore.exe', b.lower())
2681.4.2 by Alexander Belchenko
test for get_app_path
199
            self.assertNotEquals('', d)
200
4476.2.1 by Alexander Belchenko
win32utils.py: get_app_path() can read path for wordpad.exe (data type_id is REG_EXPAND_SZ).
201
    def test_wordpad(self):
202
        # typical windows users should have wordpad in the system
203
        # but there is problem: its path has the format REG_EXPAND_SZ
204
        # so naive attempt to get the path is not working
205
        for a in ('wordpad', 'wordpad.exe'):
206
            p = get_app_path(a)
207
            d, b = os.path.split(p)
208
            self.assertEquals('wordpad.exe', b.lower())
209
            self.assertNotEquals('', d)
210
2681.4.2 by Alexander Belchenko
test for get_app_path
211
    def test_not_existing(self):
212
        p = get_app_path('not-existing')
213
        self.assertEquals('not-existing', p)
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
214
3638.4.3 by Mark Hammond
cleanup tests, rationalize path checking etc.
215
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
216
class TestLocationsCtypes(TestCase):
217
218
    _test_needs_features = [CtypesFeature]
219
3638.4.3 by Mark Hammond
cleanup tests, rationalize path checking etc.
220
    def assertPathsEqual(self, p1, p2):
221
        # TODO: The env var values in particular might return the "short"
222
        # version (ie, "C:\DOCUME~1\...").  Its even possible the returned
223
        # values will differ only by case - handle these situations as we
224
        # come across them.
225
        self.assertEquals(p1, p2)
226
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
227
    def test_appdata_not_using_environment(self):
228
        # Test that we aren't falling back to the environment
3638.4.3 by Mark Hammond
cleanup tests, rationalize path checking etc.
229
        first = win32utils.get_appdata_location()
230
        self._captureVar("APPDATA", None)
231
        self.assertPathsEqual(first, win32utils.get_appdata_location())
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
232
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
233
    def test_appdata_matches_environment(self):
234
        # Typically the APPDATA environment variable will match
235
        # get_appdata_location
3638.4.3 by Mark Hammond
cleanup tests, rationalize path checking etc.
236
        # XXX - See bug 262874, which asserts the correct encoding is 'mbcs',
237
        encoding = osutils.get_user_encoding()
3638.4.6 by Mark Hammond
Skip the environment checks when APPDATA isn't in the environment.
238
        env_val = os.environ.get("APPDATA", None)
239
        if not env_val:
240
            raise TestSkipped("No APPDATA environment variable exists")
3638.4.3 by Mark Hammond
cleanup tests, rationalize path checking etc.
241
        self.assertPathsEqual(win32utils.get_appdata_location(),
3638.4.6 by Mark Hammond
Skip the environment checks when APPDATA isn't in the environment.
242
                              env_val.decode(encoding))
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
243
244
    def test_local_appdata_not_using_environment(self):
245
        # Test that we aren't falling back to the environment
3638.4.3 by Mark Hammond
cleanup tests, rationalize path checking etc.
246
        first = win32utils.get_local_appdata_location()
247
        self._captureVar("LOCALAPPDATA", None)
248
        self.assertPathsEqual(first, win32utils.get_local_appdata_location())
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
249
250
    def test_local_appdata_matches_environment(self):
251
        # LOCALAPPDATA typically only exists on Vista, so we only attempt to
252
        # compare when it exists.
3638.4.3 by Mark Hammond
cleanup tests, rationalize path checking etc.
253
        lad = win32utils.get_local_appdata_location()
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
254
        env = os.environ.get("LOCALAPPDATA")
255
        if env:
3638.4.3 by Mark Hammond
cleanup tests, rationalize path checking etc.
256
            # XXX - See bug 262874, which asserts the correct encoding is 'mbcs'
257
            encoding = osutils.get_user_encoding()
258
            self.assertPathsEqual(lad, env.decode(encoding))
259
260
261
class TestLocationsPywin32(TestLocationsCtypes):
3638.4.1 by Mark Hammond
Add win32utils.get_local_appdata_location() so bzr and plugins can
262
263
    _test_needs_features = [Win32comShellFeature]
264
265
    def setUp(self):
3638.4.3 by Mark Hammond
cleanup tests, rationalize path checking etc.
266
        super(TestLocationsPywin32, self).setUp()
267
        # We perform the exact same tests after disabling the use of ctypes.
268
        # This causes the implementation to fall back to pywin32.
4985.1.5 by Vincent Ladeuil
Deploying the new overrideAttr facility further reduces the complexity
269
        self.overrideAttr(win32utils, 'has_ctypes', False)
270
        # FIXME: this should be done by parametrization -- vila 100123
4505.2.1 by Alexander Belchenko
Set hidden attribute on .bzr directory below unicode path should never fail with error. The operation should succeed even if bzr unable to set the attribute. (related to bug #335362).
271
272
273
class TestSetHidden(TestCaseInTempDir):
274
4505.2.3 by Alexander Belchenko
added direct test for absolute path.
275
    def test_unicode_dir(self):
276
        # we should handle unicode paths without errors
4505.2.4 by Alexander Belchenko
guard tests with UnicodeFilenameFeature.
277
        self.requireFeature(UnicodeFilenameFeature)
4505.2.3 by Alexander Belchenko
added direct test for absolute path.
278
        os.mkdir(u'\u1234')
279
        win32utils.set_file_attr_hidden(u'\u1234')
280
281
    def test_dot_bzr_in_unicode_dir(self):
4505.2.1 by Alexander Belchenko
Set hidden attribute on .bzr directory below unicode path should never fail with error. The operation should succeed even if bzr unable to set the attribute. (related to bug #335362).
282
        # we should not raise traceback if we try to set hidden attribute
283
        # on .bzr directory below unicode path
4505.2.4 by Alexander Belchenko
guard tests with UnicodeFilenameFeature.
284
        self.requireFeature(UnicodeFilenameFeature)
4505.2.3 by Alexander Belchenko
added direct test for absolute path.
285
        os.makedirs(u'\u1234\\.bzr')
286
        path = osutils.abspath(u'\u1234\\.bzr')
287
        win32utils.set_file_attr_hidden(path)
4786.1.1 by John Arbash Meinel
Work on doing globbing, etc for all commands on Windows.
288
289
290
291
292
class Test_CommandLineToArgv(tests.TestCaseInTempDir):
293
4913.5.11 by Gordon Tyler
Added optional single quote support to UnicodeShlex and thus command_line_to_argv (defaults to disabled).
294
    def assertCommandLine(self, expected, line, single_quotes_allowed=False):
4789.3.2 by Vincent Ladeuil
Add a comment precising why we sort the results of _command_line_to_argv.
295
        # Strictly speaking we should respect parameter order versus glob
296
        # expansions, but it's not really worth the effort here
4913.5.25 by Gordon Tyler
Simplified win32utils.command_line_to_argv and made it private since it's no longer used outside of the module.
297
        argv = win32utils._command_line_to_argv(line,
4913.5.11 by Gordon Tyler
Added optional single quote support to UnicodeShlex and thus command_line_to_argv (defaults to disabled).
298
                single_quotes_allowed=single_quotes_allowed)
299
        self.assertEqual(expected, sorted(argv))
4786.1.1 by John Arbash Meinel
Work on doing globbing, etc for all commands on Windows.
300
301
    def test_glob_paths(self):
302
        self.build_tree(['a/', 'a/b.c', 'a/c.c', 'a/c.h'])
303
        self.assertCommandLine([u'a/b.c', u'a/c.c'], 'a/*.c')
304
        self.build_tree(['b/', 'b/b.c', 'b/d.c', 'b/d.h'])
305
        self.assertCommandLine([u'a/b.c', u'b/b.c'], '*/b.c')
306
        self.assertCommandLine([u'a/b.c', u'a/c.c', u'b/b.c', u'b/d.c'],
307
                               '*/*.c')
308
        # Bash style, just pass through the argument if nothing matches
309
        self.assertCommandLine([u'*/*.qqq'], '*/*.qqq')
310
311
    def test_quoted_globs(self):
312
        self.build_tree(['a/', 'a/b.c', 'a/c.c', 'a/c.h'])
313
        self.assertCommandLine([u'a/*.c'], '"a/*.c"')
4789.1.1 by Alexander Belchenko
In standard windows shell single quote is not supported as quote. Restored standard windows behavior.
314
        self.assertCommandLine([u"'a/*.c'"], "'a/*.c'")
4913.5.11 by Gordon Tyler
Added optional single quote support to UnicodeShlex and thus command_line_to_argv (defaults to disabled).
315
        self.assertCommandLine([u'a/*.c'], "'a/*.c'",
316
            single_quotes_allowed=True)
4786.1.2 by John Arbash Meinel
Refactor the glob_expand code a bit, making the inner function more reusable.
317
318
    def test_slashes_changed(self):
4818.1.1 by John Arbash Meinel
Fix bug #485771. Only change '/' to '/' when expanding globs.
319
        # Quoting doesn't change the supplied args
320
        self.assertCommandLine([u'a\\*.c'], '"a\\*.c"')
4913.5.11 by Gordon Tyler
Added optional single quote support to UnicodeShlex and thus command_line_to_argv (defaults to disabled).
321
        self.assertCommandLine([u'a\\*.c'], "'a\\*.c'",
322
            single_quotes_allowed=True)
4818.1.1 by John Arbash Meinel
Fix bug #485771. Only change '/' to '/' when expanding globs.
323
        # Expands the glob, but nothing matches, swaps slashes
4786.1.2 by John Arbash Meinel
Refactor the glob_expand code a bit, making the inner function more reusable.
324
        self.assertCommandLine([u'a/*.c'], 'a\\*.c')
4818.1.1 by John Arbash Meinel
Fix bug #485771. Only change '/' to '/' when expanding globs.
325
        self.assertCommandLine([u'a/?.c'], 'a\\?.c')
326
        # No glob, doesn't touch slashes
327
        self.assertCommandLine([u'a\\foo.c'], 'a\\foo.c')
4789.1.1 by Alexander Belchenko
In standard windows shell single quote is not supported as quote. Restored standard windows behavior.
328
4913.5.11 by Gordon Tyler
Added optional single quote support to UnicodeShlex and thus command_line_to_argv (defaults to disabled).
329
    def test_single_quote_support(self):
4789.1.1 by Alexander Belchenko
In standard windows shell single quote is not supported as quote. Restored standard windows behavior.
330
        self.assertCommandLine(["add", "let's-do-it.txt"],
331
            "add let's-do-it.txt")
4913.5.11 by Gordon Tyler
Added optional single quote support to UnicodeShlex and thus command_line_to_argv (defaults to disabled).
332
        self.assertCommandLine(["add", "lets do it.txt"],
333
            "add 'lets do it.txt'", single_quotes_allowed=True)
4797.3.20 by John Arbash Meinel
Include the glob updates.
334
4789.20.3 by John Arbash Meinel
Use the right case sensitivity feature (cicp, not just ci).
335
    def test_case_insensitive_globs(self):
336
        self.requireFeature(tests.CaseInsCasePresFilenameFeature)
337
        self.build_tree(['a/', 'a/b.c', 'a/c.c', 'a/c.h'])
338
        self.assertCommandLine([u'A/b.c'], 'A/B*')
339
340
    def test_backslashes(self):
341
        self.requireFeature(BackslashDirSeparatorFeature)
342
        self.build_tree(['a/', 'a/b.c', 'a/c.c', 'a/c.h'])
343
        self.assertCommandLine([u'a/b.c'], 'a\\b*')