summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-31 00:43:41 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-31 00:43:41 +0300
commitccd0e0afcdb107ddd097ad8e347e70ce5029e6a2 (patch)
treedaad63e6fd3b21e95afa72f9764d50266616c74e /tests/basics
parent25c84643b6c4da169cdb11de54f027e3c477c301 (diff)
downloadmicropython-ccd0e0afcdb107ddd097ad8e347e70ce5029e6a2.tar.gz
micropython-ccd0e0afcdb107ddd097ad8e347e70ce5029e6a2.zip
tests: Add test for break in for.
For #635 / 25c84643b6c4da169cdb11de54f027e3c477c301.
Diffstat (limited to 'tests/basics')
-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()