diff options
Diffstat (limited to 'modules/gdscript/tests/scripts/parser')
8 files changed, 30 insertions, 4 deletions
diff --git a/modules/gdscript/tests/scripts/parser/errors/duplicate_tool.out b/modules/gdscript/tests/scripts/parser/errors/duplicate_tool.out index 26fe23fb78..497d361204 100644 --- a/modules/gdscript/tests/scripts/parser/errors/duplicate_tool.out +++ b/modules/gdscript/tests/scripts/parser/errors/duplicate_tool.out @@ -1,2 +1,2 @@ -GDTEST_ANALYZER_ERROR +GDTEST_PARSER_ERROR "@tool" annotation can only be used once. diff --git a/modules/gdscript/tests/scripts/parser/features/class_inheritance_access.gd b/modules/gdscript/tests/scripts/parser/features/class_inheritance_access.gd index eb392672eb..2e1407237f 100644 --- a/modules/gdscript/tests/scripts/parser/features/class_inheritance_access.gd +++ b/modules/gdscript/tests/scripts/parser/features/class_inheritance_access.gd @@ -4,6 +4,7 @@ class Parent: var parent_variable := 2 + @warning_ignore("unused_signal") signal parent_signal var parent_attribute: int: diff --git a/modules/gdscript/tests/scripts/parser/features/lambda_ends_with_new_line.gd b/modules/gdscript/tests/scripts/parser/features/lambda_ends_with_new_line.gd index f16c768f7f..46b6856d22 100644 --- a/modules/gdscript/tests/scripts/parser/features/lambda_ends_with_new_line.gd +++ b/modules/gdscript/tests/scripts/parser/features/lambda_ends_with_new_line.gd @@ -14,6 +14,7 @@ func test(): print(v) print() + @warning_ignore("standalone_ternary") v=func(): print(2) if false else print(3) @warning_ignore("unsafe_cast") (v as Callable).call() diff --git a/modules/gdscript/tests/scripts/parser/features/match.gd b/modules/gdscript/tests/scripts/parser/features/match.gd index 59b5ba2426..a2e93c64fd 100644 --- a/modules/gdscript/tests/scripts/parser/features/match.gd +++ b/modules/gdscript/tests/scripts/parser/features/match.gd @@ -14,3 +14,6 @@ func test(): print("This won't match") _: print("This will match") + + match 0: + pass diff --git a/modules/gdscript/tests/scripts/parser/features/signal_declaration.gd b/modules/gdscript/tests/scripts/parser/features/signal_declaration.gd index e4d6a72f90..d02f82d417 100644 --- a/modules/gdscript/tests/scripts/parser/features/signal_declaration.gd +++ b/modules/gdscript/tests/scripts/parser/features/signal_declaration.gd @@ -1,5 +1,3 @@ -#GDTEST_OK - # No parentheses. signal a @@ -16,5 +14,15 @@ signal d( c, ) +# With type hints. +signal e(a: int, b: Variant, c: Node) + +func no_exec(): + a.emit() + b.emit() + c.emit() + d.emit() + e.emit() + func test(): print("Ok") diff --git a/modules/gdscript/tests/scripts/parser/warnings/incompatible_ternary.out b/modules/gdscript/tests/scripts/parser/warnings/incompatible_ternary.out index 7d1558c6fc..ff3e827255 100644 --- a/modules/gdscript/tests/scripts/parser/warnings/incompatible_ternary.out +++ b/modules/gdscript/tests/scripts/parser/warnings/incompatible_ternary.out @@ -2,4 +2,4 @@ GDTEST_OK >> WARNING >> Line: 8 >> INCOMPATIBLE_TERNARY ->> Values of the ternary conditional are not mutually compatible. +>> Values of the ternary operator are not mutually compatible. diff --git a/modules/gdscript/tests/scripts/parser/warnings/standalone_ternary.gd b/modules/gdscript/tests/scripts/parser/warnings/standalone_ternary.gd new file mode 100644 index 0000000000..9b296e02e1 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/warnings/standalone_ternary.gd @@ -0,0 +1,3 @@ +func test(): + 1 if true else 2 + print(1) if true else print(2) diff --git a/modules/gdscript/tests/scripts/parser/warnings/standalone_ternary.out b/modules/gdscript/tests/scripts/parser/warnings/standalone_ternary.out new file mode 100644 index 0000000000..477449e0e3 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/warnings/standalone_ternary.out @@ -0,0 +1,10 @@ +GDTEST_OK +>> WARNING +>> Line: 2 +>> STANDALONE_TERNARY +>> Standalone ternary operator: the return value is being discarded. +>> WARNING +>> Line: 3 +>> STANDALONE_TERNARY +>> Standalone ternary operator: the return value is being discarded. +1 |