summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/parser/errors
diff options
context:
space:
mode:
authorDanil Alexeev <danil@alexeev.xyz>2023-04-14 20:45:49 +0300
committerDanil Alexeev <danil@alexeev.xyz>2023-04-20 07:44:10 +0300
commitdbc3c82043122e0bc71b9d8617b572dac020ceb1 (patch)
tree0c6b60d1e1bad72c8205307c5ee71853c5f206bb /modules/gdscript/tests/scripts/parser/errors
parent27253f3eb2c78a9ad5114c92eae2036b10e1d7e0 (diff)
downloadredot-engine-dbc3c82043122e0bc71b9d8617b572dac020ceb1.tar.gz
GDScript: Add some checks for `@tool` and `@icon`
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/errors')
-rw-r--r--modules/gdscript/tests/scripts/parser/errors/duplicate_icon.gd5
-rw-r--r--modules/gdscript/tests/scripts/parser/errors/duplicate_icon.out2
-rw-r--r--modules/gdscript/tests/scripts/parser/errors/duplicate_tool.gd5
-rw-r--r--modules/gdscript/tests/scripts/parser/errors/duplicate_tool.out2
4 files changed, 14 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/errors/duplicate_icon.gd b/modules/gdscript/tests/scripts/parser/errors/duplicate_icon.gd
new file mode 100644
index 0000000000..7500e406f6
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/errors/duplicate_icon.gd
@@ -0,0 +1,5 @@
+@icon("res://1.png")
+@icon("res://1.png")
+
+func test():
+ pass
diff --git a/modules/gdscript/tests/scripts/parser/errors/duplicate_icon.out b/modules/gdscript/tests/scripts/parser/errors/duplicate_icon.out
new file mode 100644
index 0000000000..d6cbc95d10
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/errors/duplicate_icon.out
@@ -0,0 +1,2 @@
+GDTEST_PARSER_ERROR
+"@icon" annotation can only be used once.
diff --git a/modules/gdscript/tests/scripts/parser/errors/duplicate_tool.gd b/modules/gdscript/tests/scripts/parser/errors/duplicate_tool.gd
new file mode 100644
index 0000000000..3a2f7118f9
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/errors/duplicate_tool.gd
@@ -0,0 +1,5 @@
+@tool
+@tool
+
+func test():
+ pass
diff --git a/modules/gdscript/tests/scripts/parser/errors/duplicate_tool.out b/modules/gdscript/tests/scripts/parser/errors/duplicate_tool.out
new file mode 100644
index 0000000000..26fe23fb78
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/errors/duplicate_tool.out
@@ -0,0 +1,2 @@
+GDTEST_ANALYZER_ERROR
+"@tool" annotation can only be used once.