diff options
Diffstat (limited to 'modules/gdscript/tests')
5 files changed, 37 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.gd b/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.gd new file mode 100644 index 0000000000..caeea46977 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.gd @@ -0,0 +1,9 @@ +# GH-75645 + +extends Node + +static func static_func(): + var a = $Node + +func test(): + pass diff --git a/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.out b/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.out new file mode 100644 index 0000000000..1910b3e66b --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/get_node_shorthand_in_static_function.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +Cannot use shorthand "get_node()" notation ("$") in a static function. diff --git a/modules/gdscript/tests/scripts/parser/.editorconfig b/modules/gdscript/tests/scripts/parser/.editorconfig new file mode 100644 index 0000000000..fa43b3ad78 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/.editorconfig @@ -0,0 +1,2 @@ +[*.{gd,out}] +trim_trailing_whitespace = false diff --git a/modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines.gd b/modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines.gd new file mode 100644 index 0000000000..7ee2708999 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines.gd @@ -0,0 +1,20 @@ +# Empty line: + + +# Comment line: + # Comment. + +func test(): + print(1) + + if true: + + # Empty line: + + + print(2) + + # Comment line: + # Comment. + + print(3) diff --git a/modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines.out b/modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines.out new file mode 100644 index 0000000000..c40e402ba3 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines.out @@ -0,0 +1,4 @@ +GDTEST_OK +1 +2 +3 |