diff options
author | Ma Lin <animalize@users.noreply.github.com> | 2022-04-19 14:49:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-19 14:49:36 (GMT) |
commit | e4e8895ae36b44994e3f7b018345ba203ce6b55c (patch) | |
tree | 75dfc4577b68bc470c900256e157c189a2585464 /Lib/test/test_pathlib.py | |
parent | 061a8bf77c80036bed3ef4973fe0c99705c83fc6 (diff) | |
download | cpython-e4e8895ae36b44994e3f7b018345ba203ce6b55c.zip cpython-e4e8895ae36b44994e3f7b018345ba203ce6b55c.tar.gz cpython-e4e8895ae36b44994e3f7b018345ba203ce6b55c.tar.bz2 |
gh-91616: re module, fix .fullmatch() mismatch when using Atomic Grouping or Possessive Quantifiers (GH-91681)
These jumps should use DO_JUMP0() instead of DO_JUMP():
- JUMP_POSS_REPEAT_1
- JUMP_POSS_REPEAT_2
- JUMP_ATOMIC_GROUP
Diffstat (limited to 'Lib/test/test_pathlib.py')
-rw-r--r-- | Lib/test/test_pathlib.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index 66e4447..b8b08bf 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -1388,6 +1388,7 @@ class _BasePathTest(object): # | |-- dirD # | | `-- fileD # | `-- fileC + # | `-- novel.txt # |-- dirE # No permissions # |-- fileA # |-- linkA -> fileA @@ -1412,6 +1413,8 @@ class _BasePathTest(object): f.write(b"this is file B\n") with open(join('dirC', 'fileC'), 'wb') as f: f.write(b"this is file C\n") + with open(join('dirC', 'novel.txt'), 'wb') as f: + f.write(b"this is a novel\n") with open(join('dirC', 'dirD', 'fileD'), 'wb') as f: f.write(b"this is file D\n") os.chmod(join('dirE'), 0) @@ -1679,6 +1682,9 @@ class _BasePathTest(object): p = P(BASE, "dirC") _check(p.rglob("file*"), ["dirC/fileC", "dirC/dirD/fileD"]) _check(p.rglob("*/*"), ["dirC/dirD/fileD"]) + # gh-91616, a re module regression + _check(p.rglob("*.txt"), ["dirC/novel.txt"]) + _check(p.rglob("*.*"), ["dirC/novel.txt"]) @os_helper.skip_unless_symlink def test_rglob_symlink_loop(self): @@ -1689,7 +1695,8 @@ class _BasePathTest(object): expect = {'brokenLink', 'dirA', 'dirA/linkC', 'dirB', 'dirB/fileB', 'dirB/linkD', - 'dirC', 'dirC/dirD', 'dirC/dirD/fileD', 'dirC/fileC', + 'dirC', 'dirC/dirD', 'dirC/dirD/fileD', + 'dirC/fileC', 'dirC/novel.txt', 'dirE', 'fileA', 'linkA', |