Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 01515bd

Browse files
committed
Tests assert that empty strings are non-boundary
Signed-off-by: y5c4l3 <[email protected]>
1 parent c044334 commit 01515bd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Lib/test/test_re.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,9 +893,8 @@ def test_string_boundaries(self):
893893
self.assertTrue(re.search(r"\B", "abc"))
894894
# There is no non-boundary match at the start of a string.
895895
self.assertFalse(re.match(r"\B", "abc"))
896-
# However, an empty string contains no word boundaries, and also no
897-
# non-boundaries.
898-
self.assertIsNone(re.search(r"\B", ""))
896+
# gh-124130: An empty string should be non-boundary.
897+
self.assertTrue(re.match(r"\B", ""))
899898
# This one is questionable and different from the perlre behaviour,
900899
# but describes current behavior.
901900
self.assertIsNone(re.search(r"\b", ""))

0 commit comments

Comments
 (0)