summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorHynek Schlawack <hs@ox.cx>2012-12-16 11:44:07 (GMT)
committerHynek Schlawack <hs@ox.cx>2012-12-16 11:44:07 (GMT)
commit9ca589333844997713394b65dba9548c5887e750 (patch)
treeb7209c7b6b8a72ada56e9b3429c33dd100af8ae9 /Lib
parent040e3118267bda53b34e35470f7ef0f6dc40cfad (diff)
parentdec59ec5ff9f48d1fe9bf8f5ff3874ef9f0f54ad (diff)
downloadcpython-9ca589333844997713394b65dba9548c5887e750.zip
cpython-9ca589333844997713394b65dba9548c5887e750.tar.gz
cpython-9ca589333844997713394b65dba9548c5887e750.tar.bz2
#16664: Add regression tests for glob's behaviour concerning "."-entries
Patch by Sebastian Kreft.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_glob.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
index 6ee08db..806f26b 100644
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -5,6 +5,7 @@ import glob
import os
import shutil
+
class GlobTests(unittest.TestCase):
def norm(self, *parts):
@@ -18,9 +19,11 @@ class GlobTests(unittest.TestCase):
create_empty_file(filename)
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'), [])