diff options
author | Hynek Schlawack <hs@ox.cx> | 2012-12-16 11:30:57 (GMT) |
---|---|---|
committer | Hynek Schlawack <hs@ox.cx> | 2012-12-16 11:30:57 (GMT) |
commit | 646c7b50860a5171a127f01a511bfc887a0cb72e (patch) | |
tree | 5d35df00ae2c8bf8c0d22cc82cb68f93eb332447 /Lib/test | |
parent | b41524dde3f0145371c0ad501fa895f755731e9d (diff) | |
download | cpython-646c7b50860a5171a127f01a511bfc887a0cb72e.zip cpython-646c7b50860a5171a127f01a511bfc887a0cb72e.tar.gz cpython-646c7b50860a5171a127f01a511bfc887a0cb72e.tar.bz2 |
#16664: Add regression tests for glob's behaviour concerning "."-entries
Patch by Sebastian Kreft.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_glob.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py index 692322d..285c169 100644 --- a/Lib/test/test_glob.py +++ b/Lib/test/test_glob.py @@ -4,6 +4,7 @@ import glob import os import shutil + class GlobTests(unittest.TestCase): def norm(self, *parts): @@ -18,9 +19,11 @@ class GlobTests(unittest.TestCase): f.close() def setUp(self): - self.tempdir = TESTFN+"_dir" + self.tempdir = TESTFN + "_dir" self.mktemp('a', 'D') self.mktemp('aab', 'F') + self.mktemp('.aa', 'G') + self.mktemp('.bb', 'H') self.mktemp('aaa', 'zzzF') self.mktemp('ZZZ') self.mktemp('a', 'bcd', 'EF') @@ -66,6 +69,8 @@ class GlobTests(unittest.TestCase): eq = self.assertSequencesEqual_noorder eq(self.glob('a*'), map(self.norm, ['a', 'aab', 'aaa'])) eq(self.glob('*a'), map(self.norm, ['a', 'aaa'])) + eq(self.glob('.*'), map(self.norm, ['.aa', '.bb'])) + eq(self.glob('?aa'), map(self.norm, ['aaa'])) eq(self.glob('aa?'), map(self.norm, ['aaa', 'aab'])) eq(self.glob('aa[ab]'), map(self.norm, ['aaa', 'aab'])) eq(self.glob('*q'), []) |