summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/parser/errors
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-09-15 11:43:36 -0300
committerGeorge Marques <george@gmarqu.es>2021-09-15 11:43:36 -0300
commit107af38fd185eb6cecd1bf889ccd437cf7a87046 (patch)
treec2efec92f654ab66e980002e5f43c669e972922e /modules/gdscript/tests/scripts/parser/errors
parenta5c299630d865ca61a1943c9ce38936f9ac18063 (diff)
GDScript: Show error when missing expression after ternary else
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/errors')
-rw-r--r--modules/gdscript/tests/scripts/parser/errors/missing_expression_after_ternary_else.gd4
-rw-r--r--modules/gdscript/tests/scripts/parser/errors/missing_expression_after_ternary_else.out2
2 files changed, 6 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/errors/missing_expression_after_ternary_else.gd b/modules/gdscript/tests/scripts/parser/errors/missing_expression_after_ternary_else.gd
new file mode 100644
index 0000000000..1f66935329
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/errors/missing_expression_after_ternary_else.gd
@@ -0,0 +1,4 @@
+func test():
+ var x = 1 if false else
+ print("oops")
+ print(x)
diff --git a/modules/gdscript/tests/scripts/parser/errors/missing_expression_after_ternary_else.out b/modules/gdscript/tests/scripts/parser/errors/missing_expression_after_ternary_else.out
new file mode 100644
index 0000000000..dab6b0a1ad
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/errors/missing_expression_after_ternary_else.out
@@ -0,0 +1,2 @@
+GDTEST_PARSER_ERROR
+Expected expression after "else".