summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2023-01-18 09:13:35 +1100
committerDamien George <damien@micropython.org>2023-01-18 09:15:32 +1100
commitfc745d85febd3f8d407f38a5002ae39fba39cd07 (patch)
tree0ffcabc332e53bd887e5d06821077c4d49a8ee7c
parent64193c7de9f53e01dca447a4a902398fe85b9c06 (diff)
tests/extmod/ure_namedclass: Add tests for named classes in class sets.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--tests/extmod/ure_namedclass.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/extmod/ure_namedclass.py b/tests/extmod/ure_namedclass.py
index 00d58ad98..4afc09dc0 100644
--- a/tests/extmod/ure_namedclass.py
+++ b/tests/extmod/ure_namedclass.py
@@ -15,7 +15,7 @@ def print_groups(match):
try:
i = 0
while True:
- print(m.group(i))
+ print(match.group(i))
i += 1
except IndexError:
pass
@@ -32,3 +32,8 @@ print_groups(m)
m = re.match(r"(([0-9]*)([a-z]*)\d*)", "1234hello567")
print_groups(m)
+
+# named class within a class set
+print_groups(re.match("([^\s]+)\s*([^\s]+)", "1 23"))
+print_groups(re.match("([\s\d]+)([\W]+)", "1 2-+="))
+print_groups(re.match("([\W]+)([^\W]+)([^\S]+)([^\D]+)", " a_1 23"))