summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/parser/warnings
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/warnings')
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/incompatible_ternary.out2
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/standalone_ternary.gd3
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/standalone_ternary.out10
3 files changed, 14 insertions, 1 deletions
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