You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
tests: Add test for modure when regex has errors.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# test errors in regex
|
||||
|
||||
try:
|
||||
import ure as re
|
||||
except:
|
||||
import re
|
||||
|
||||
def test_re(r):
|
||||
try:
|
||||
re.compile(r)
|
||||
print("OK")
|
||||
except: # uPy and CPy use different errors, so just ignore the type
|
||||
print("Error")
|
||||
|
||||
test_re(r'?')
|
||||
test_re(r'*')
|
||||
test_re(r'+')
|
||||
test_re(r')')
|
||||
test_re(r'[')
|
||||
test_re(r'([')
|
||||
test_re(r'([)')
|
||||
Reference in New Issue
Block a user