summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests
diff options
context:
space:
mode:
authorDmitrii Maganov <vonagam@gmail.com>2023-02-24 00:01:27 +0200
committerDmitrii Maganov <vonagam@gmail.com>2023-02-24 00:35:11 +0200
commit55c5774be948752665059ba205336e1571b2f057 (patch)
tree445c1ac6f51aa8b837e1f5234f8253dd442ded6c /modules/gdscript/tests
parente930c8d3838280e40baabc4426bd8236f7ac50a3 (diff)
GDScript: Fix range regression
Diffstat (limited to 'modules/gdscript/tests')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/for_range_usage.gd7
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/for_range_usage.out2
2 files changed, 9 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/for_range_usage.gd b/modules/gdscript/tests/scripts/analyzer/features/for_range_usage.gd
new file mode 100644
index 0000000000..4a7f10f1ee
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/for_range_usage.gd
@@ -0,0 +1,7 @@
+func test():
+ var array := [3, 6, 9]
+ var result := ''
+ for i in range(array.size(), 0, -1):
+ result += str(array[i - 1])
+ assert(result == '963')
+ print('ok')
diff --git a/modules/gdscript/tests/scripts/analyzer/features/for_range_usage.out b/modules/gdscript/tests/scripts/analyzer/features/for_range_usage.out
new file mode 100644
index 0000000000..1b47ed10dc
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/for_range_usage.out
@@ -0,0 +1,2 @@
+GDTEST_OK
+ok