summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--tests/basics/for_break.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/basics/for_break.py b/tests/basics/for_break.py
new file mode 100644
index 0000000000..fa8dabd150
--- /dev/null
+++ b/tests/basics/for_break.py
@@ -0,0 +1,15 @@
+# Testcase for break in a for [within bunch of other code]
+# https://github.com/micropython/micropython/issues/635
+
+def foo():
+ seq = [1, 2, 3]
+ v = 100
+ i = 5
+ while i > 0:
+ print(i)
+ for a in seq:
+ if a == 2:
+ break
+ i -= 1
+
+foo()