Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixup
  • Loading branch information
StanFromIreland committed Jun 26, 2025
commit fcbd4b23805d8375653d41440e0f0ee4452f8d17
8 changes: 4 additions & 4 deletions Lib/test/test_re.py
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ def test_flags(self):
for flag in [re.I, re.M, re.X, re.S, re.A, re.L]:
self.assertTrue(re.compile(b'^pattern$', flag))

def test_character_literals(self):
def test_sre_character_literals(self):
for i in [0, 8, 16, 32, 64, 127, 128, 255, 256, 0xFFFF, 0x10000, 0x10FFFF]:
if i < 256:
self.assertTrue(re.match(r"\%03o" % i, chr(i)))
Expand Down Expand Up @@ -1476,7 +1476,7 @@ def test_character_literals(self):
self.checkPatternError(r"\U0001234z", r'incomplete escape \U0001234', 0)
self.checkPatternError(r"\U00110000", r'bad escape \U00110000', 0)

def test_character_class_literals(self):
def test_sre_character_class_literals(self):
for i in [0, 8, 16, 32, 64, 127, 128, 255, 256, 0xFFFF, 0x10000, 0x10FFFF]:
if i < 256:
self.assertTrue(re.match(r"[\%o]" % i, chr(i)))
Expand Down Expand Up @@ -1504,7 +1504,7 @@ def test_character_class_literals(self):
self.checkPatternError(r"[\U00110000]", r'bad escape \U00110000', 1)
self.assertTrue(re.match(r"[\U0001d49c-\U0001d4b5]", "\U0001d49e"))

def test_byte_literals(self):
def test_sre_byte_literals(self):
for i in [0, 8, 16, 32, 64, 127, 128, 255]:
self.assertTrue(re.match((r"\%03o" % i).encode(), bytes([i])))
self.assertTrue(re.match((r"\%03o0" % i).encode(), bytes([i])+b"0"))
Expand All @@ -1525,7 +1525,7 @@ def test_byte_literals(self):
self.checkPatternError(br"\x1", r'incomplete escape \x1', 0)
self.checkPatternError(br"\x1z", r'incomplete escape \x1', 0)

def test_byte_class_literals(self):
def test_sre_byte_class_literals(self):
for i in [0, 8, 16, 32, 64, 127, 128, 255]:
self.assertTrue(re.match((r"[\%o]" % i).encode(), bytes([i])))
self.assertTrue(re.match((r"[\%o8]" % i).encode(), bytes([i])))
Expand Down