summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/tests/for1.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basics/tests/for1.py b/tests/basics/tests/for1.py
index 5a2635638d..c6199416cd 100644
--- a/tests/basics/tests/for1.py
+++ b/tests/basics/tests/for1.py
@@ -7,3 +7,13 @@ def f():
print(x, y, z)
f()
+
+# range with negative step
+for i in range(3, -1, -1):
+ print(i)
+
+a = -1
+# range with non-constant step - we optimize constant steps, so this
+# will be executed differently
+for i in range(3, -1, a):
+ print(i)