diff options
| author | Glenn Ruben Bakke <glennbakke@gmail.com> | 2017-10-04 21:45:04 +0200 |
|---|---|---|
| committer | Glenn Ruben Bakke <glennbakke@gmail.com> | 2017-10-04 21:45:04 +0200 |
| commit | bcab2ba0a80297100919366add6bada140c6ed75 (patch) | |
| tree | 5133218f4fc010d5688f006dbdd1e2f346a843f7 /tests/extmod | |
| parent | 4468731e3d039a3f72ac25aa43e936cf5ebb3f78 (diff) | |
| parent | f869d6b2e339c04469c6c9ea3fb2fabd7bbb2d8c (diff) | |
ports/nrf: Upmerging port with upstream master
Diffstat (limited to 'tests/extmod')
| -rw-r--r-- | tests/extmod/ubinascii_a2b_base64.py | 7 | ||||
| -rw-r--r-- | tests/extmod/ure_stack_overflow.py | 13 | ||||
| -rw-r--r-- | tests/extmod/ure_stack_overflow.py.exp | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/extmod/ubinascii_a2b_base64.py b/tests/extmod/ubinascii_a2b_base64.py index b35f26591..05a3169f3 100644 --- a/tests/extmod/ubinascii_a2b_base64.py +++ b/tests/extmod/ubinascii_a2b_base64.py @@ -21,6 +21,13 @@ print(binascii.a2b_base64(b'f4D/')) print(binascii.a2b_base64(b'f4D+')) # convert '+' print(binascii.a2b_base64(b'MTIzNEFCQ0RhYmNk')) +# Ignore invalid characters and pad sequences +print(binascii.a2b_base64(b'Zm9v\n')) +print(binascii.a2b_base64(b'Zm\x009v\n')) +print(binascii.a2b_base64(b'Zm9v==')) +print(binascii.a2b_base64(b'Zm9v===')) +print(binascii.a2b_base64(b'Zm9v===YmFy')) + try: print(binascii.a2b_base64(b'abc')) except ValueError: diff --git a/tests/extmod/ure_stack_overflow.py b/tests/extmod/ure_stack_overflow.py new file mode 100644 index 000000000..d3ce0c5a7 --- /dev/null +++ b/tests/extmod/ure_stack_overflow.py @@ -0,0 +1,13 @@ +try: + import ure as re +except ImportError: + try: + import re + except ImportError: + print("SKIP") + raise SystemExit + +try: + re.match("(a*)*", "aaa") +except RuntimeError: + print("RuntimeError") diff --git a/tests/extmod/ure_stack_overflow.py.exp b/tests/extmod/ure_stack_overflow.py.exp new file mode 100644 index 000000000..8a2b9bfdd --- /dev/null +++ b/tests/extmod/ure_stack_overflow.py.exp @@ -0,0 +1 @@ +RuntimeError |
