From 1e26bf23c22b2e425be3ee1b00326a0af129337f Mon Sep 17 00:00:00 2001 From: "Andrii Doroshenko (Xrayez)" Date: Fri, 16 Apr 2021 22:16:19 +0300 Subject: Rename GDScript test script filenames to use `snake_case` --- .../gdscript/tests/scripts/parser-errors/missing-argument.gd | 6 ------ .../tests/scripts/parser-errors/missing-argument.out | 2 -- .../scripts/parser-errors/missing-closing-expr-paren.gd | 2 -- .../scripts/parser-errors/missing-closing-expr-paren.out | 2 -- .../gdscript/tests/scripts/parser-errors/missing-colon.gd | 3 --- .../gdscript/tests/scripts/parser-errors/missing-colon.out | 2 -- .../tests/scripts/parser-errors/missing-paren-after-args.gd | 6 ------ .../tests/scripts/parser-errors/missing-paren-after-args.out | 2 -- .../tests/scripts/parser-errors/mixing-tabs-spaces.gd | 3 --- .../tests/scripts/parser-errors/mixing-tabs-spaces.out | 2 -- .../tests/scripts/parser-errors/nothing-after-dollar.gd | 3 --- .../tests/scripts/parser-errors/nothing-after-dollar.out | 2 -- .../scripts/parser-errors/wrong-value-after-dollar-slash.gd | 3 --- .../scripts/parser-errors/wrong-value-after-dollar-slash.out | 2 -- .../tests/scripts/parser-errors/wrong-value-after-dollar.gd | 3 --- .../tests/scripts/parser-errors/wrong-value-after-dollar.out | 2 -- .../scripts/parser-features/semicolon-as-end-statement.gd | 2 -- .../scripts/parser-features/semicolon-as-end-statement.out | 3 --- .../parser-features/trailing-comma-in-function-args.gd | 7 ------- .../parser-features/trailing-comma-in-function-args.out | 2 -- .../tests/scripts/parser-features/variable-declaration.gd | 12 ------------ .../tests/scripts/parser-features/variable-declaration.out | 7 ------- .../tests/scripts/parser-warnings/unused-variable.gd | 2 -- .../tests/scripts/parser-warnings/unused-variable.out | 5 ----- .../gdscript/tests/scripts/parser/errors/missing_argument.gd | 6 ++++++ .../tests/scripts/parser/errors/missing_argument.out | 2 ++ .../scripts/parser/errors/missing_closing_expr_paren.gd | 2 ++ .../scripts/parser/errors/missing_closing_expr_paren.out | 2 ++ .../gdscript/tests/scripts/parser/errors/missing_colon.gd | 3 +++ .../gdscript/tests/scripts/parser/errors/missing_colon.out | 2 ++ .../tests/scripts/parser/errors/missing_paren_after_args.gd | 6 ++++++ .../tests/scripts/parser/errors/missing_paren_after_args.out | 2 ++ .../tests/scripts/parser/errors/mixing_tabs_spaces.gd | 3 +++ .../tests/scripts/parser/errors/mixing_tabs_spaces.out | 2 ++ .../tests/scripts/parser/errors/nothing_after_dollar.gd | 3 +++ .../tests/scripts/parser/errors/nothing_after_dollar.out | 2 ++ .../tests/scripts/parser/errors/wrong_value_after_dollar.gd | 3 +++ .../tests/scripts/parser/errors/wrong_value_after_dollar.out | 2 ++ .../scripts/parser/errors/wrong_value_after_dollar_slash.gd | 3 +++ .../scripts/parser/errors/wrong_value_after_dollar_slash.out | 2 ++ .../scripts/parser/features/semicolon_as_end_statement.gd | 2 ++ .../scripts/parser/features/semicolon_as_end_statement.out | 3 +++ .../parser/features/trailing_comma_in_function_args.gd | 7 +++++++ .../parser/features/trailing_comma_in_function_args.out | 2 ++ .../tests/scripts/parser/features/variable_declaration.gd | 12 ++++++++++++ .../tests/scripts/parser/features/variable_declaration.out | 7 +++++++ .../tests/scripts/parser/warnings/unused_variable.gd | 2 ++ .../tests/scripts/parser/warnings/unused_variable.out | 5 +++++ 48 files changed, 85 insertions(+), 85 deletions(-) delete mode 100644 modules/gdscript/tests/scripts/parser-errors/missing-argument.gd delete mode 100644 modules/gdscript/tests/scripts/parser-errors/missing-argument.out delete mode 100644 modules/gdscript/tests/scripts/parser-errors/missing-closing-expr-paren.gd delete mode 100644 modules/gdscript/tests/scripts/parser-errors/missing-closing-expr-paren.out delete mode 100644 modules/gdscript/tests/scripts/parser-errors/missing-colon.gd delete mode 100644 modules/gdscript/tests/scripts/parser-errors/missing-colon.out delete mode 100644 modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd delete mode 100644 modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.out delete mode 100644 modules/gdscript/tests/scripts/parser-errors/mixing-tabs-spaces.gd delete mode 100644 modules/gdscript/tests/scripts/parser-errors/mixing-tabs-spaces.out delete mode 100644 modules/gdscript/tests/scripts/parser-errors/nothing-after-dollar.gd delete mode 100644 modules/gdscript/tests/scripts/parser-errors/nothing-after-dollar.out delete mode 100644 modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar-slash.gd delete mode 100644 modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar-slash.out delete mode 100644 modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar.gd delete mode 100644 modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar.out delete mode 100644 modules/gdscript/tests/scripts/parser-features/semicolon-as-end-statement.gd delete mode 100644 modules/gdscript/tests/scripts/parser-features/semicolon-as-end-statement.out delete mode 100644 modules/gdscript/tests/scripts/parser-features/trailing-comma-in-function-args.gd delete mode 100644 modules/gdscript/tests/scripts/parser-features/trailing-comma-in-function-args.out delete mode 100644 modules/gdscript/tests/scripts/parser-features/variable-declaration.gd delete mode 100644 modules/gdscript/tests/scripts/parser-features/variable-declaration.out delete mode 100644 modules/gdscript/tests/scripts/parser-warnings/unused-variable.gd delete mode 100644 modules/gdscript/tests/scripts/parser-warnings/unused-variable.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/missing_argument.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/missing_argument.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/missing_closing_expr_paren.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/missing_closing_expr_paren.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/missing_colon.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/missing_colon.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/missing_paren_after_args.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/missing_paren_after_args.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/nothing_after_dollar.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/nothing_after_dollar.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar_slash.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar_slash.out create mode 100644 modules/gdscript/tests/scripts/parser/features/semicolon_as_end_statement.gd create mode 100644 modules/gdscript/tests/scripts/parser/features/semicolon_as_end_statement.out create mode 100644 modules/gdscript/tests/scripts/parser/features/trailing_comma_in_function_args.gd create mode 100644 modules/gdscript/tests/scripts/parser/features/trailing_comma_in_function_args.out create mode 100644 modules/gdscript/tests/scripts/parser/features/variable_declaration.gd create mode 100644 modules/gdscript/tests/scripts/parser/features/variable_declaration.out create mode 100644 modules/gdscript/tests/scripts/parser/warnings/unused_variable.gd create mode 100644 modules/gdscript/tests/scripts/parser/warnings/unused_variable.out (limited to 'modules/gdscript/tests') diff --git a/modules/gdscript/tests/scripts/parser-errors/missing-argument.gd b/modules/gdscript/tests/scripts/parser-errors/missing-argument.gd deleted file mode 100644 index c56ad94095..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/missing-argument.gd +++ /dev/null @@ -1,6 +0,0 @@ -func args(a, b): - print(a) - print(b) - -func test(): - args(1,) diff --git a/modules/gdscript/tests/scripts/parser-errors/missing-argument.out b/modules/gdscript/tests/scripts/parser-errors/missing-argument.out deleted file mode 100644 index fc2a891109..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/missing-argument.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_ANALYZER_ERROR -Too few arguments for "args()" call. Expected at least 2 but received 1. diff --git a/modules/gdscript/tests/scripts/parser-errors/missing-closing-expr-paren.gd b/modules/gdscript/tests/scripts/parser-errors/missing-closing-expr-paren.gd deleted file mode 100644 index a1077e1985..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/missing-closing-expr-paren.gd +++ /dev/null @@ -1,2 +0,0 @@ -func test(): - var a = ("missing paren ->" diff --git a/modules/gdscript/tests/scripts/parser-errors/missing-closing-expr-paren.out b/modules/gdscript/tests/scripts/parser-errors/missing-closing-expr-paren.out deleted file mode 100644 index 7326afa33d..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/missing-closing-expr-paren.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_PARSER_ERROR -Expected closing ")" after grouping expression. diff --git a/modules/gdscript/tests/scripts/parser-errors/missing-colon.gd b/modules/gdscript/tests/scripts/parser-errors/missing-colon.gd deleted file mode 100644 index 62cb633e9e..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/missing-colon.gd +++ /dev/null @@ -1,3 +0,0 @@ -func test(): - if true # Missing colon here. - print("true") diff --git a/modules/gdscript/tests/scripts/parser-errors/missing-colon.out b/modules/gdscript/tests/scripts/parser-errors/missing-colon.out deleted file mode 100644 index 687b963bc8..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/missing-colon.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_PARSER_ERROR -Expected ":" after "if" condition. diff --git a/modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd b/modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd deleted file mode 100644 index 116b0151da..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd +++ /dev/null @@ -1,6 +0,0 @@ -func args(a, b): - print(a) - print(b) - -func test(): - args(1,2 diff --git a/modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.out b/modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.out deleted file mode 100644 index 34ea7ac323..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_PARSER_ERROR -Expected closing ")" after call arguments. diff --git a/modules/gdscript/tests/scripts/parser-errors/mixing-tabs-spaces.gd b/modules/gdscript/tests/scripts/parser-errors/mixing-tabs-spaces.gd deleted file mode 100644 index 9ad77f1432..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/mixing-tabs-spaces.gd +++ /dev/null @@ -1,3 +0,0 @@ -func test(): - print("Using spaces") - print("Using tabs") diff --git a/modules/gdscript/tests/scripts/parser-errors/mixing-tabs-spaces.out b/modules/gdscript/tests/scripts/parser-errors/mixing-tabs-spaces.out deleted file mode 100644 index 6390de9788..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/mixing-tabs-spaces.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_PARSER_ERROR -Used "\t" for indentation instead " " as used before in the file. diff --git a/modules/gdscript/tests/scripts/parser-errors/nothing-after-dollar.gd b/modules/gdscript/tests/scripts/parser-errors/nothing-after-dollar.gd deleted file mode 100644 index 3875ce3936..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/nothing-after-dollar.gd +++ /dev/null @@ -1,3 +0,0 @@ -extends Node -func test(): - var a = $ # Expected some node path. diff --git a/modules/gdscript/tests/scripts/parser-errors/nothing-after-dollar.out b/modules/gdscript/tests/scripts/parser-errors/nothing-after-dollar.out deleted file mode 100644 index b3dc181a22..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/nothing-after-dollar.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_PARSER_ERROR -Expect node path as string or identifier after "$". diff --git a/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar-slash.gd b/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar-slash.gd deleted file mode 100644 index 1836d42226..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar-slash.gd +++ /dev/null @@ -1,3 +0,0 @@ -extends Node -func test(): - $MyNode/23 # Can't use number here. diff --git a/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar-slash.out b/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar-slash.out deleted file mode 100644 index dcb4ccecb0..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar-slash.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_PARSER_ERROR -Expect node path after "/". diff --git a/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar.gd b/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar.gd deleted file mode 100644 index 6fd2692d47..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar.gd +++ /dev/null @@ -1,3 +0,0 @@ -extends Node -func test(): - $23 # Can't use number here. diff --git a/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar.out b/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar.out deleted file mode 100644 index b3dc181a22..0000000000 --- a/modules/gdscript/tests/scripts/parser-errors/wrong-value-after-dollar.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_PARSER_ERROR -Expect node path as string or identifier after "$". diff --git a/modules/gdscript/tests/scripts/parser-features/semicolon-as-end-statement.gd b/modules/gdscript/tests/scripts/parser-features/semicolon-as-end-statement.gd deleted file mode 100644 index 08f2eedb2d..0000000000 --- a/modules/gdscript/tests/scripts/parser-features/semicolon-as-end-statement.gd +++ /dev/null @@ -1,2 +0,0 @@ -func test(): - print("A"); print("B") diff --git a/modules/gdscript/tests/scripts/parser-features/semicolon-as-end-statement.out b/modules/gdscript/tests/scripts/parser-features/semicolon-as-end-statement.out deleted file mode 100644 index fc03f3efe8..0000000000 --- a/modules/gdscript/tests/scripts/parser-features/semicolon-as-end-statement.out +++ /dev/null @@ -1,3 +0,0 @@ -GDTEST_OK -A -B diff --git a/modules/gdscript/tests/scripts/parser-features/trailing-comma-in-function-args.gd b/modules/gdscript/tests/scripts/parser-features/trailing-comma-in-function-args.gd deleted file mode 100644 index 6097b11b10..0000000000 --- a/modules/gdscript/tests/scripts/parser-features/trailing-comma-in-function-args.gd +++ /dev/null @@ -1,7 +0,0 @@ -# See https://github.com/godotengine/godot/issues/41066. - -func f(p, ): ## <-- no errors - print(p) - -func test(): - f(0, ) ## <-- no error diff --git a/modules/gdscript/tests/scripts/parser-features/trailing-comma-in-function-args.out b/modules/gdscript/tests/scripts/parser-features/trailing-comma-in-function-args.out deleted file mode 100644 index 94e2ec2af8..0000000000 --- a/modules/gdscript/tests/scripts/parser-features/trailing-comma-in-function-args.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_OK -0 diff --git a/modules/gdscript/tests/scripts/parser-features/variable-declaration.gd b/modules/gdscript/tests/scripts/parser-features/variable-declaration.gd deleted file mode 100644 index 3b48f10ca7..0000000000 --- a/modules/gdscript/tests/scripts/parser-features/variable-declaration.gd +++ /dev/null @@ -1,12 +0,0 @@ -var a # No init. -var b = 42 # Init. - -func test(): - var c # No init, local. - var d = 23 # Init, local. - - a = 1 - c = 2 - - prints(a, b, c, d) - print("OK") diff --git a/modules/gdscript/tests/scripts/parser-features/variable-declaration.out b/modules/gdscript/tests/scripts/parser-features/variable-declaration.out deleted file mode 100644 index 2e0a63c024..0000000000 --- a/modules/gdscript/tests/scripts/parser-features/variable-declaration.out +++ /dev/null @@ -1,7 +0,0 @@ -GDTEST_OK ->> WARNING ->> Line: 5 ->> UNASSIGNED_VARIABLE ->> The variable 'c' was used but never assigned a value. -1 42 2 23 -OK diff --git a/modules/gdscript/tests/scripts/parser-warnings/unused-variable.gd b/modules/gdscript/tests/scripts/parser-warnings/unused-variable.gd deleted file mode 100644 index 68e3bd424f..0000000000 --- a/modules/gdscript/tests/scripts/parser-warnings/unused-variable.gd +++ /dev/null @@ -1,2 +0,0 @@ -func test(): - var unused = "not used" diff --git a/modules/gdscript/tests/scripts/parser-warnings/unused-variable.out b/modules/gdscript/tests/scripts/parser-warnings/unused-variable.out deleted file mode 100644 index 270e0e69c0..0000000000 --- a/modules/gdscript/tests/scripts/parser-warnings/unused-variable.out +++ /dev/null @@ -1,5 +0,0 @@ -GDTEST_OK ->> WARNING ->> Line: 2 ->> UNUSED_VARIABLE ->> The local variable 'unused' is declared but never used in the block. If this is intended, prefix it with an underscore: '_unused' diff --git a/modules/gdscript/tests/scripts/parser/errors/missing_argument.gd b/modules/gdscript/tests/scripts/parser/errors/missing_argument.gd new file mode 100644 index 0000000000..c56ad94095 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/missing_argument.gd @@ -0,0 +1,6 @@ +func args(a, b): + print(a) + print(b) + +func test(): + args(1,) diff --git a/modules/gdscript/tests/scripts/parser/errors/missing_argument.out b/modules/gdscript/tests/scripts/parser/errors/missing_argument.out new file mode 100644 index 0000000000..fc2a891109 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/missing_argument.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +Too few arguments for "args()" call. Expected at least 2 but received 1. diff --git a/modules/gdscript/tests/scripts/parser/errors/missing_closing_expr_paren.gd b/modules/gdscript/tests/scripts/parser/errors/missing_closing_expr_paren.gd new file mode 100644 index 0000000000..a1077e1985 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/missing_closing_expr_paren.gd @@ -0,0 +1,2 @@ +func test(): + var a = ("missing paren ->" diff --git a/modules/gdscript/tests/scripts/parser/errors/missing_closing_expr_paren.out b/modules/gdscript/tests/scripts/parser/errors/missing_closing_expr_paren.out new file mode 100644 index 0000000000..7326afa33d --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/missing_closing_expr_paren.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Expected closing ")" after grouping expression. diff --git a/modules/gdscript/tests/scripts/parser/errors/missing_colon.gd b/modules/gdscript/tests/scripts/parser/errors/missing_colon.gd new file mode 100644 index 0000000000..62cb633e9e --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/missing_colon.gd @@ -0,0 +1,3 @@ +func test(): + if true # Missing colon here. + print("true") diff --git a/modules/gdscript/tests/scripts/parser/errors/missing_colon.out b/modules/gdscript/tests/scripts/parser/errors/missing_colon.out new file mode 100644 index 0000000000..687b963bc8 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/missing_colon.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Expected ":" after "if" condition. diff --git a/modules/gdscript/tests/scripts/parser/errors/missing_paren_after_args.gd b/modules/gdscript/tests/scripts/parser/errors/missing_paren_after_args.gd new file mode 100644 index 0000000000..116b0151da --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/missing_paren_after_args.gd @@ -0,0 +1,6 @@ +func args(a, b): + print(a) + print(b) + +func test(): + args(1,2 diff --git a/modules/gdscript/tests/scripts/parser/errors/missing_paren_after_args.out b/modules/gdscript/tests/scripts/parser/errors/missing_paren_after_args.out new file mode 100644 index 0000000000..34ea7ac323 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/missing_paren_after_args.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Expected closing ")" after call arguments. diff --git a/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.gd b/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.gd new file mode 100644 index 0000000000..9ad77f1432 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.gd @@ -0,0 +1,3 @@ +func test(): + print("Using spaces") + print("Using tabs") diff --git a/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.out b/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.out new file mode 100644 index 0000000000..6390de9788 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Used "\t" for indentation instead " " as used before in the file. diff --git a/modules/gdscript/tests/scripts/parser/errors/nothing_after_dollar.gd b/modules/gdscript/tests/scripts/parser/errors/nothing_after_dollar.gd new file mode 100644 index 0000000000..3875ce3936 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/nothing_after_dollar.gd @@ -0,0 +1,3 @@ +extends Node +func test(): + var a = $ # Expected some node path. diff --git a/modules/gdscript/tests/scripts/parser/errors/nothing_after_dollar.out b/modules/gdscript/tests/scripts/parser/errors/nothing_after_dollar.out new file mode 100644 index 0000000000..b3dc181a22 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/nothing_after_dollar.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Expect node path as string or identifier after "$". diff --git a/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar.gd b/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar.gd new file mode 100644 index 0000000000..6fd2692d47 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar.gd @@ -0,0 +1,3 @@ +extends Node +func test(): + $23 # Can't use number here. diff --git a/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar.out b/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar.out new file mode 100644 index 0000000000..b3dc181a22 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Expect node path as string or identifier after "$". diff --git a/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar_slash.gd b/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar_slash.gd new file mode 100644 index 0000000000..1836d42226 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar_slash.gd @@ -0,0 +1,3 @@ +extends Node +func test(): + $MyNode/23 # Can't use number here. diff --git a/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar_slash.out b/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar_slash.out new file mode 100644 index 0000000000..dcb4ccecb0 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/wrong_value_after_dollar_slash.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Expect node path after "/". diff --git a/modules/gdscript/tests/scripts/parser/features/semicolon_as_end_statement.gd b/modules/gdscript/tests/scripts/parser/features/semicolon_as_end_statement.gd new file mode 100644 index 0000000000..08f2eedb2d --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/semicolon_as_end_statement.gd @@ -0,0 +1,2 @@ +func test(): + print("A"); print("B") diff --git a/modules/gdscript/tests/scripts/parser/features/semicolon_as_end_statement.out b/modules/gdscript/tests/scripts/parser/features/semicolon_as_end_statement.out new file mode 100644 index 0000000000..fc03f3efe8 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/semicolon_as_end_statement.out @@ -0,0 +1,3 @@ +GDTEST_OK +A +B diff --git a/modules/gdscript/tests/scripts/parser/features/trailing_comma_in_function_args.gd b/modules/gdscript/tests/scripts/parser/features/trailing_comma_in_function_args.gd new file mode 100644 index 0000000000..6097b11b10 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/trailing_comma_in_function_args.gd @@ -0,0 +1,7 @@ +# See https://github.com/godotengine/godot/issues/41066. + +func f(p, ): ## <-- no errors + print(p) + +func test(): + f(0, ) ## <-- no error diff --git a/modules/gdscript/tests/scripts/parser/features/trailing_comma_in_function_args.out b/modules/gdscript/tests/scripts/parser/features/trailing_comma_in_function_args.out new file mode 100644 index 0000000000..94e2ec2af8 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/trailing_comma_in_function_args.out @@ -0,0 +1,2 @@ +GDTEST_OK +0 diff --git a/modules/gdscript/tests/scripts/parser/features/variable_declaration.gd b/modules/gdscript/tests/scripts/parser/features/variable_declaration.gd new file mode 100644 index 0000000000..3b48f10ca7 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/variable_declaration.gd @@ -0,0 +1,12 @@ +var a # No init. +var b = 42 # Init. + +func test(): + var c # No init, local. + var d = 23 # Init, local. + + a = 1 + c = 2 + + prints(a, b, c, d) + print("OK") diff --git a/modules/gdscript/tests/scripts/parser/features/variable_declaration.out b/modules/gdscript/tests/scripts/parser/features/variable_declaration.out new file mode 100644 index 0000000000..2e0a63c024 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/variable_declaration.out @@ -0,0 +1,7 @@ +GDTEST_OK +>> WARNING +>> Line: 5 +>> UNASSIGNED_VARIABLE +>> The variable 'c' was used but never assigned a value. +1 42 2 23 +OK diff --git a/modules/gdscript/tests/scripts/parser/warnings/unused_variable.gd b/modules/gdscript/tests/scripts/parser/warnings/unused_variable.gd new file mode 100644 index 0000000000..68e3bd424f --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/warnings/unused_variable.gd @@ -0,0 +1,2 @@ +func test(): + var unused = "not used" diff --git a/modules/gdscript/tests/scripts/parser/warnings/unused_variable.out b/modules/gdscript/tests/scripts/parser/warnings/unused_variable.out new file mode 100644 index 0000000000..270e0e69c0 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/warnings/unused_variable.out @@ -0,0 +1,5 @@ +GDTEST_OK +>> WARNING +>> Line: 2 +>> UNUSED_VARIABLE +>> The local variable 'unused' is declared but never used in the block. If this is intended, prefix it with an underscore: '_unused' -- cgit v1.2.3