From 651319de11d0c3c4b3278b846b77cb3d034beae3 Mon Sep 17 00:00:00 2001 From: George Marques Date: Fri, 17 Sep 2021 14:31:51 -0300 Subject: GDScript: Properly catch error when missing index in subscript --- .../gdscript/tests/scripts/parser/errors/subscript_without_index.gd | 3 +++ .../gdscript/tests/scripts/parser/errors/subscript_without_index.out | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 modules/gdscript/tests/scripts/parser/errors/subscript_without_index.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/subscript_without_index.out (limited to 'modules/gdscript/tests') diff --git a/modules/gdscript/tests/scripts/parser/errors/subscript_without_index.gd b/modules/gdscript/tests/scripts/parser/errors/subscript_without_index.gd new file mode 100644 index 0000000000..c30c05e4da --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/subscript_without_index.gd @@ -0,0 +1,3 @@ +func test(): + var array = [1, 2, 3] + array[] = 4 diff --git a/modules/gdscript/tests/scripts/parser/errors/subscript_without_index.out b/modules/gdscript/tests/scripts/parser/errors/subscript_without_index.out new file mode 100644 index 0000000000..7017c7b4aa --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/subscript_without_index.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Expected expression after "[". -- cgit v1.2.3