Skip to content

Commit a803c5a

Browse files
committed
test: compare glob behavior across Python versions
1 parent 27f14e8 commit a803c5a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎tests/common/test_pattern_matching.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ def test_leading_star_globs_keep_fnmatch_search_semantics(self):
7676
for pattern in patterns:
7777
original = re.compile(fnmatch.translate(pattern))
7878
filter_ = RegexFactory.path_matcher(pattern)
79-
assert filter_.regexp.pattern == original.pattern
8079
optimized = filter_.search_regexp
8180
assert optimized is not None
8281
for path in paths:
82+
assert bool(filter_.regexp.match(path)) == bool(original.match(path)), (
83+
pattern,
84+
path,
85+
)
8386
assert bool(optimized.search(path)) == bool(original.search(path)), (
8487
pattern,
8588
path,

0 commit comments

Comments
 (0)