Commit 9ca58933 authored by Hynek Schlawack's avatar Hynek Schlawack

#16664: Add regression tests for glob's behaviour concerning "."-entries

Patch by Sebastian Kreft.
parents 040e3118 dec59ec5
...@@ -5,6 +5,7 @@ import glob ...@@ -5,6 +5,7 @@ import glob
import os import os
import shutil import shutil
class GlobTests(unittest.TestCase): class GlobTests(unittest.TestCase):
def norm(self, *parts): def norm(self, *parts):
...@@ -18,9 +19,11 @@ class GlobTests(unittest.TestCase): ...@@ -18,9 +19,11 @@ class GlobTests(unittest.TestCase):
create_empty_file(filename) create_empty_file(filename)
def setUp(self): def setUp(self):
self.tempdir = TESTFN+"_dir" self.tempdir = TESTFN + "_dir"
self.mktemp('a', 'D') self.mktemp('a', 'D')
self.mktemp('aab', 'F') self.mktemp('aab', 'F')
self.mktemp('.aa', 'G')
self.mktemp('.bb', 'H')
self.mktemp('aaa', 'zzzF') self.mktemp('aaa', 'zzzF')
self.mktemp('ZZZ') self.mktemp('ZZZ')
self.mktemp('a', 'bcd', 'EF') self.mktemp('a', 'bcd', 'EF')
...@@ -66,6 +69,8 @@ class GlobTests(unittest.TestCase): ...@@ -66,6 +69,8 @@ class GlobTests(unittest.TestCase):
eq = self.assertSequencesEqual_noorder eq = self.assertSequencesEqual_noorder
eq(self.glob('a*'), map(self.norm, ['a', 'aab', 'aaa'])) eq(self.glob('a*'), map(self.norm, ['a', 'aab', 'aaa']))
eq(self.glob('*a'), map(self.norm, ['a', '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?'), map(self.norm, ['aaa', 'aab']))
eq(self.glob('aa[ab]'), map(self.norm, ['aaa', 'aab'])) eq(self.glob('aa[ab]'), map(self.norm, ['aaa', 'aab']))
eq(self.glob('*q'), []) eq(self.glob('*q'), [])
......
...@@ -647,6 +647,7 @@ Jerzy Kozera ...@@ -647,6 +647,7 @@ Jerzy Kozera
Maksim Kozyarchuk Maksim Kozyarchuk
Stefan Krah Stefan Krah
Bob Kras Bob Kras
Sebastian Kreft
Holger Krekel Holger Krekel
Michael Kremer Michael Kremer
Fabian Kreutz Fabian Kreutz
......
...@@ -40,7 +40,7 @@ Core and Builtins ...@@ -40,7 +40,7 @@ Core and Builtins
- Issue #9535: Fix pending signals that have been received but not yet - Issue #9535: Fix pending signals that have been received but not yet
handled by Python to not persist after os.fork() in the child process. handled by Python to not persist after os.fork() in the child process.
- 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. Stinner.
- Issue #8271: the utf-8 decoder now outputs the correct number of U+FFFD - Issue #8271: the utf-8 decoder now outputs the correct number of U+FFFD
...@@ -306,6 +306,9 @@ Library ...@@ -306,6 +306,9 @@ Library
Tests Tests
----- -----
- Issue #16664: Add regression tests for glob's behaviour concerning entries
starting with a ".". Patch by Sebastian Kreft.
- Issue #16559: Add more tests for the json module, including some from the - Issue #16559: Add more tests for the json module, including some from the
official test suite at json.org. Patch by Serhiy Storchaka. official test suite at json.org. Patch by Serhiy Storchaka.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment