[Python-checkins] cpython (merge 3.3 -> default): #16664: Add regression tests for glob's behaviour concerning "."-entries

hynek.schlawack python-checkins at python.org
Sun Dec 16 12:49:08 CET 2012


http://hg.python.org/cpython/rev/1fb39efcc3dd
changeset:   80877:1fb39efcc3dd
parent:      80873:7c9327ff5de6
parent:      80876:f646842023b3
user:        Hynek Schlawack <hs at ox.cx>
date:        Sun Dec 16 12:46:58 2012 +0100
summary:
  #16664: Add regression tests for glob's behaviour concerning "."-entries

Patch by Sebastian Kreft.

files:
  Lib/test/test_glob.py |  7 ++++++-
  Misc/ACKS             |  1 +
  Misc/NEWS             |  5 ++++-
  3 files changed, 11 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -5,6 +5,7 @@
 import os
 import shutil
 
+
 class GlobTests(unittest.TestCase):
 
     def norm(self, *parts):
@@ -18,9 +19,11 @@
         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 @@
         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'), [])
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -650,6 +650,7 @@
 Maksim Kozyarchuk
 Stefan Krah
 Bob Kras
+Sebastian Kreft
 Holger Krekel
 Michael Kremer
 Fabian Kreutz
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -67,7 +67,7 @@
 - Issue #14794: Fix slice.indices to return correct results for huge values,
   rather than raising OverflowError.
 
-- Issue #15001: fix segfault on "del sys.module['__main__']". Patch by Victor
+- Issue #15001: fix segfault on "del sys.modules['__main__']". Patch by Victor
   Stinner.
 
 - Issue #8271: the utf-8 decoder now outputs the correct number of U+FFFD
@@ -470,6 +470,9 @@
 Tests
 -----
 
+- Issue #16664: Add regression tests for glob's behaviour concerning entries
+  starting with a ".".  Patch by Sebastian Kreft.
+
 - Issue #13390: The ``-R`` option to regrtest now also checks for memory
   allocation leaks, using :func:`sys.getallocatedblocks()`.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list