diff options
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/errors')
4 files changed, 12 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.gd b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.gd new file mode 100644 index 0000000000..9f1a52856d --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.gd @@ -0,0 +1,4 @@ +@export_enum("A", "B", "C") var x: Array[Color] + +func test(): + pass diff --git a/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.out b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.out new file mode 100644 index 0000000000..1e0455b96d --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +"@export_enum" annotation requires a variable of type "int", "Array[int]", "PackedByteArray", "PackedInt32Array", "PackedInt64Array", "String", "Array[String]", or "PackedStringArray", but type "Array[Color]" was given instead. diff --git a/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.gd b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.gd new file mode 100644 index 0000000000..5fe66e7cce --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.gd @@ -0,0 +1,4 @@ +@export_enum("A", "B", "C") var x: Color + +func test(): + pass diff --git a/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.out b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.out new file mode 100644 index 0000000000..43a08acc0a --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +"@export_enum" annotation requires a variable of type "int", "Array[int]", "PackedByteArray", "PackedInt32Array", "PackedInt64Array", "String", "Array[String]", or "PackedStringArray", but type "Color" was given instead. |