Add more integration tests to the GDScript test suite

This also fixes a typo in the `bitwise_float_right_operand.gd` test.
This commit is contained in:
Hugo Locurcio
2021-09-15 19:09:34 +02:00
parent 520462e98c
commit c6ca09dc6f
30 changed files with 245 additions and 2 deletions
@@ -0,0 +1,3 @@
func test() {
print("Hello world!");
}
@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected ":" after function declaration.
@@ -0,0 +1,2 @@
func test():
var escape = "invalid escape \h <- here"
@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Invalid escape in string.
@@ -0,0 +1,5 @@
func test():
var amount = 50
# C-style ternary operator is invalid in GDScript.
# The valid syntax is `"yes" if amount < 60 else "no"`, like in Python.
var ternary = amount < 60 ? "yes" : "no"
@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Unexpected "?" in source. If you want a ternary operator, use "truthy_value if true_condition else falsy_value".
@@ -0,0 +1,13 @@
# The VCS conflict marker has only 6 `=` signs instead of 7 to prevent editors like
# Visual Studio Code from recognizing it as an actual VCS conflict marker.
# Nonetheless, the GDScript parser is still expected to find and report the VCS
# conflict marker error correctly.
<<<<<<< HEAD
Hello world
======
Goodbye
>>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086
func test():
pass
@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Unexpected "VCS conflict marker" in class body.