Merge pull request #52718 from Calinou/gdscript-add-integration-tests-2

This commit is contained in:
Rémi Verschelde
2021-09-21 14:13:24 +02:00
committed by GitHub
30 changed files with 245 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
func test() {
print("Hello world!");
}

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected ":" after function declaration.

View File

@@ -0,0 +1,2 @@
func test():
var escape = "invalid escape \h <- here"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Invalid escape in string.

View File

@@ -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"

View File

@@ -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".

View File

@@ -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

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Unexpected "VCS conflict marker" in class body.