Skip to content

Commit fc745d8

Browse files
committed
tests/extmod/ure_namedclass: Add tests for named classes in class sets.
Signed-off-by: Damien George <[email protected]>
1 parent 64193c7 commit fc745d8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/extmod/ure_namedclass.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def print_groups(match):
1515
try:
1616
i = 0
1717
while True:
18-
print(m.group(i))
18+
print(match.group(i))
1919
i += 1
2020
except IndexError:
2121
pass
@@ -32,3 +32,8 @@ def print_groups(match):
3232

3333
m = re.match(r"(([0-9]*)([a-z]*)\d*)", "1234hello567")
3434
print_groups(m)
35+
36+
# named class within a class set
37+
print_groups(re.match("([^\s]+)\s*([^\s]+)", "1 23"))
38+
print_groups(re.match("([\s\d]+)([\W]+)", "1 2-+="))
39+
print_groups(re.match("([\W]+)([^\W]+)([^\S]+)([^\D]+)", " a_1 23"))

0 commit comments

Comments
 (0)