summaryrefslogtreecommitdiff
path: root/tests/extmod/ure1.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extmod/ure1.py')
-rw-r--r--tests/extmod/ure1.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/extmod/ure1.py b/tests/extmod/ure1.py
index 9e1be5fc7..2bdf2d0cf 100644
--- a/tests/extmod/ure1.py
+++ b/tests/extmod/ure1.py
@@ -125,3 +125,14 @@ print(re.compile(r"[ax\-]").split("foo-bar"))
print(re.compile(r"[a\-x]").split("foo-bar"))
print(re.compile(r"[\-ax]").split("foo-bar"))
print("===")
+
+# Module functions take str/bytes/re.
+for f in (re.match, re.search):
+ print(f(".", "foo").group(0))
+ print(f(b".", b"foo").group(0))
+ print(f(re.compile("."), "foo").group(0))
+ try:
+ f(123, "a")
+ except TypeError:
+ print("TypeError")
+print("===")