From 646c7b50860a5171a127f01a511bfc887a0cb72e Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Sun, 16 Dec 2012 12:30:57 +0100 Subject: #16664: Add regression tests for glob's behaviour concerning "."-entries Patch by Sebastian Kreft. --- Lib/test/test_glob.py | 7 ++++++- Misc/ACKS | 1 + Misc/NEWS | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) 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'), []) diff --git a/Misc/ACKS b/Misc/ACKS index 8e6fa2a..ea7bea5 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -540,6 +540,7 @@ Jerzy Kozera Maksim Kozyarchuk Stefan Krah Bob Kras +Sebastian Kreft Holger Krekel Michael Kremer Fabian Kreutz diff --git a/Misc/NEWS b/Misc/NEWS index de2f3ba..44b9b06 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -548,6 +548,9 @@ Extension Modules Tests ----- +- Issue #16664: Add regression tests for glob's behaviour concerning entries + starting with a ".". Patch by Sebastian Kreft. + - Issue #15747: ZFS always returns EOPNOTSUPP when attempting to set the UF_IMMUTABLE flag (via either chflags or lchflags); refactor affected tests in test_posix.py to account for this. -- cgit v0.12