Skip to content

Commit

Permalink
Tests assert that empty strings are non-boundary
Browse files Browse the repository at this point in the history
Signed-off-by: y5c4l3 <y5c4l3@proton.me>
  • Loading branch information
y5c4l3 committed Sep 16, 2024
1 parent a38ee0e commit 5dfaf17
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Lib/test/test_re.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,9 +893,8 @@ def test_string_boundaries(self):
self.assertTrue(re.search(r"\B", "abc"))
# There is no non-boundary match at the start of a string.
self.assertFalse(re.match(r"\B", "abc"))
# However, an empty string contains no word boundaries, and also no
# non-boundaries.
self.assertIsNone(re.search(r"\B", ""))
# gh-124130: An empty string should be non-boundary.
self.assertTrue(re.match(r"\B", ""))
# This one is questionable and different from the perlre behaviour,
# but describes current behavior.
self.assertIsNone(re.search(r"\b", ""))
Expand Down

0 comments on commit 5dfaf17

Please sign in to comment.