diff options
author | Damien George <damien.p.george@gmail.com> | 2015-03-10 17:47:43 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-03-10 17:47:43 +0000 |
commit | 55278dcc763e62513af02118e6bbd74707007e8d (patch) | |
tree | c7ff12f17051e4fcfd286a93fd504ab85041536a /tests | |
parent | 8dead2a6c64e8589e06e1e218d40e63aea18a009 (diff) | |
download | micropython-55278dcc763e62513af02118e6bbd74707007e8d.tar.gz micropython-55278dcc763e62513af02118e6bbd74707007e8d.zip |
tests: Add test for modure when regex has errors.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/extmod/ure_error.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/extmod/ure_error.py b/tests/extmod/ure_error.py new file mode 100644 index 0000000000..1e9f66a9e5 --- /dev/null +++ b/tests/extmod/ure_error.py @@ -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'([)') |