From 55c5774be948752665059ba205336e1571b2f057 Mon Sep 17 00:00:00 2001 From: Dmitrii Maganov Date: Fri, 24 Feb 2023 00:01:27 +0200 Subject: GDScript: Fix range regression --- .../gdscript/tests/scripts/analyzer/features/for_range_usage.gd | 7 +++++++ .../gdscript/tests/scripts/analyzer/features/for_range_usage.out | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 modules/gdscript/tests/scripts/analyzer/features/for_range_usage.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/features/for_range_usage.out (limited to 'modules/gdscript/tests') 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 -- cgit v1.2.3