summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/ure_stack_overflow.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-10-03 00:24:32 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-10-03 00:24:32 +0300
commit8e0b9f495b1967bf7503bfe4e66687955eee1922 (patch)
tree3b471bc04dcc8b07018ab4f58db795c64df5f4ff /tests/extmod/ure_stack_overflow.py
parentaba1f9167a7db1c0f19d2ab44a8dbfe5c18cc062 (diff)
downloadmicropython-8e0b9f495b1967bf7503bfe4e66687955eee1922.tar.gz
micropython-8e0b9f495b1967bf7503bfe4e66687955eee1922.zip
tests/extmod: Add test for ure regexes leading to infinite recursion.
These now should be caught properly and lead to RuntimeError instead of crash.
Diffstat (limited to 'tests/extmod/ure_stack_overflow.py')
-rw-r--r--tests/extmod/ure_stack_overflow.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/extmod/ure_stack_overflow.py b/tests/extmod/ure_stack_overflow.py
new file mode 100644
index 0000000000..d3ce0c5a7b
--- /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")