summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-06-21 10:14:13 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-06-21 10:14:13 +0200
commit5ac2631af780f7baf6adedfabfff1618d0703257 (patch)
treeb8cf77417bf9b95b5f3aef38bcc4394f3c429d05 /modules/gdscript/tests
parente5c0f60c591ea57e31d2d96778500a354d198ad2 (diff)
parent48e297c1443b38c9a3f2176a593d77d135cc1d87 (diff)
downloadredot-engine-5ac2631af780f7baf6adedfabfff1618d0703257.tar.gz
Merge pull request #92688 from HolonProduction/autocompletion-batch-2
Add more autocompletion tests
Diffstat (limited to 'modules/gdscript/tests')
-rw-r--r--modules/gdscript/tests/scripts/completion/common/identifiers.cfg21
-rw-r--r--modules/gdscript/tests/scripts/completion/common/identifiers.gd16
-rw-r--r--modules/gdscript/tests/scripts/completion/common/self.cfg21
-rw-r--r--modules/gdscript/tests/scripts/completion/common/self.gd16
-rw-r--r--modules/gdscript/tests/scripts/completion/filter/organized_export.cfg6
-rw-r--r--modules/gdscript/tests/scripts/completion/filter/organized_export.gd8
-rw-r--r--modules/gdscript/tests/scripts/completion/filter/usage_internal.cfg4
-rw-r--r--modules/gdscript/tests/scripts/completion/filter/usage_internal.gd3
-rw-r--r--modules/gdscript/tests/scripts/completion/types/local/interfered.cfg12
-rw-r--r--modules/gdscript/tests/scripts/completion/types/local/interfered.gd8
-rw-r--r--modules/gdscript/tests/scripts/completion/types/local/no_type.cfg12
-rw-r--r--modules/gdscript/tests/scripts/completion/types/local/no_type.gd8
-rw-r--r--modules/gdscript/tests/scripts/completion/types/local/typehint.cfg12
-rw-r--r--modules/gdscript/tests/scripts/completion/types/local/typehint.gd8
-rw-r--r--modules/gdscript/tests/scripts/completion/types/local/typehint_broad.cfg12
-rw-r--r--modules/gdscript/tests/scripts/completion/types/local/typehint_broad.gd8
-rw-r--r--modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.cfg12
-rw-r--r--modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.gd8
-rw-r--r--modules/gdscript/tests/scripts/completion/types/member/interfered.cfg12
-rw-r--r--modules/gdscript/tests/scripts/completion/types/member/interfered.gd9
-rw-r--r--modules/gdscript/tests/scripts/completion/types/member/no_type.cfg12
-rw-r--r--modules/gdscript/tests/scripts/completion/types/member/no_type.gd9
-rw-r--r--modules/gdscript/tests/scripts/completion/types/member/typehint.cfg12
-rw-r--r--modules/gdscript/tests/scripts/completion/types/member/typehint.gd9
-rw-r--r--modules/gdscript/tests/scripts/completion/types/member/typehint_broad.cfg13
-rw-r--r--modules/gdscript/tests/scripts/completion/types/member/typehint_broad.gd9
-rw-r--r--modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.cfg12
-rw-r--r--modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.gd9
28 files changed, 301 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/completion/common/identifiers.cfg b/modules/gdscript/tests/scripts/completion/common/identifiers.cfg
new file mode 100644
index 0000000000..871a404e3a
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/common/identifiers.cfg
@@ -0,0 +1,21 @@
+scene="res://completion/get_node/get_node.tscn"
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+
+ ; GDScript: self.gd
+ {"display": "test_signal_1"},
+ {"display": "test_signal_2"},
+ {"display": "test_var_1"},
+ {"display": "test_var_2"},
+ {"display": "test_func_1"},
+ {"display": "test_func_2"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/common/identifiers.gd b/modules/gdscript/tests/scripts/completion/common/identifiers.gd
new file mode 100644
index 0000000000..efbafbee8e
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/common/identifiers.gd
@@ -0,0 +1,16 @@
+extends "res://completion/class_a.notest.gd"
+
+signal test_signal_1(a)
+signal test_signal_2(a: int)
+
+var test_var_1
+var test_var_2: int
+
+func test_func_1(t):
+ pass
+
+func test_func_2(t: int) -> void:
+ pass
+
+func _init():
+ t➡
diff --git a/modules/gdscript/tests/scripts/completion/common/self.cfg b/modules/gdscript/tests/scripts/completion/common/self.cfg
new file mode 100644
index 0000000000..871a404e3a
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/common/self.cfg
@@ -0,0 +1,21 @@
+scene="res://completion/get_node/get_node.tscn"
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+
+ ; GDScript: self.gd
+ {"display": "test_signal_1"},
+ {"display": "test_signal_2"},
+ {"display": "test_var_1"},
+ {"display": "test_var_2"},
+ {"display": "test_func_1"},
+ {"display": "test_func_2"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/common/self.gd b/modules/gdscript/tests/scripts/completion/common/self.gd
new file mode 100644
index 0000000000..9ad2fbea51
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/common/self.gd
@@ -0,0 +1,16 @@
+extends "res://completion/class_a.notest.gd"
+
+signal test_signal_1(a)
+signal test_signal_2(a: int)
+
+var test_var_1
+var test_var_2: int
+
+func test_func_1(t):
+ pass
+
+func test_func_2(t: int) -> void:
+ pass
+
+func _init():
+ self.➡
diff --git a/modules/gdscript/tests/scripts/completion/filter/organized_export.cfg b/modules/gdscript/tests/scripts/completion/filter/organized_export.cfg
new file mode 100644
index 0000000000..961a9ea58d
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/filter/organized_export.cfg
@@ -0,0 +1,6 @@
+[output]
+exclude=[
+ {"display": "Test Category"},
+ {"display": "Test Group"},
+ {"display": "Test Subgroup"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/filter/organized_export.gd b/modules/gdscript/tests/scripts/completion/filter/organized_export.gd
new file mode 100644
index 0000000000..189608904c
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/filter/organized_export.gd
@@ -0,0 +1,8 @@
+extends CPUParticles2D
+
+@export_category("Test Category")
+@export_group("Test Group")
+@export_subgroup("Test Subgroup")
+
+func _init():
+ ➡
diff --git a/modules/gdscript/tests/scripts/completion/filter/usage_internal.cfg b/modules/gdscript/tests/scripts/completion/filter/usage_internal.cfg
new file mode 100644
index 0000000000..8c5bff5eac
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/filter/usage_internal.cfg
@@ -0,0 +1,4 @@
+[output]
+exclude=[
+ {"display": "messages"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/filter/usage_internal.gd b/modules/gdscript/tests/scripts/completion/filter/usage_internal.gd
new file mode 100644
index 0000000000..484c1c0d10
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/filter/usage_internal.gd
@@ -0,0 +1,3 @@
+func test():
+ var trans = Translation.new()
+ trans.➡
diff --git a/modules/gdscript/tests/scripts/completion/types/local/interfered.cfg b/modules/gdscript/tests/scripts/completion/types/local/interfered.cfg
new file mode 100644
index 0000000000..8b68d51a89
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/local/interfered.cfg
@@ -0,0 +1,12 @@
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/types/local/interfered.gd b/modules/gdscript/tests/scripts/completion/types/local/interfered.gd
new file mode 100644
index 0000000000..f003c366a4
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/local/interfered.gd
@@ -0,0 +1,8 @@
+extends Node
+
+const A := preload("res://completion/class_a.notest.gd")
+
+func a():
+ var test := A.new()
+ test.➡
+ pass
diff --git a/modules/gdscript/tests/scripts/completion/types/local/no_type.cfg b/modules/gdscript/tests/scripts/completion/types/local/no_type.cfg
new file mode 100644
index 0000000000..8b68d51a89
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/local/no_type.cfg
@@ -0,0 +1,12 @@
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/types/local/no_type.gd b/modules/gdscript/tests/scripts/completion/types/local/no_type.gd
new file mode 100644
index 0000000000..f6b5ae3aef
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/local/no_type.gd
@@ -0,0 +1,8 @@
+extends Node
+
+const A := preload("res://completion/class_a.notest.gd")
+
+func a():
+ var test = A.new()
+ test.➡
+ pass
diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint.cfg b/modules/gdscript/tests/scripts/completion/types/local/typehint.cfg
new file mode 100644
index 0000000000..8b68d51a89
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/local/typehint.cfg
@@ -0,0 +1,12 @@
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint.gd b/modules/gdscript/tests/scripts/completion/types/local/typehint.gd
new file mode 100644
index 0000000000..24bcfc04fc
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/local/typehint.gd
@@ -0,0 +1,8 @@
+extends Node
+
+const A := preload("res://completion/class_a.notest.gd")
+
+func a():
+ var test: A
+ test.➡
+ pass
diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.cfg b/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.cfg
new file mode 100644
index 0000000000..8b68d51a89
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.cfg
@@ -0,0 +1,12 @@
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.gd b/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.gd
new file mode 100644
index 0000000000..88b4812c30
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.gd
@@ -0,0 +1,8 @@
+extends Node
+
+const A := preload("res://completion/class_a.notest.gd")
+
+func a():
+ var test: Node = A.new()
+ test.➡
+ pass
diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.cfg b/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.cfg
new file mode 100644
index 0000000000..8b68d51a89
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.cfg
@@ -0,0 +1,12 @@
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.gd b/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.gd
new file mode 100644
index 0000000000..8e226546f3
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.gd
@@ -0,0 +1,8 @@
+extends Node
+
+const A := preload("res://completion/class_a.notest.gd")
+
+func a():
+ var test: A = Node.new()
+ test.➡
+ pass
diff --git a/modules/gdscript/tests/scripts/completion/types/member/interfered.cfg b/modules/gdscript/tests/scripts/completion/types/member/interfered.cfg
new file mode 100644
index 0000000000..8b68d51a89
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/member/interfered.cfg
@@ -0,0 +1,12 @@
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/types/member/interfered.gd b/modules/gdscript/tests/scripts/completion/types/member/interfered.gd
new file mode 100644
index 0000000000..069abd7891
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/member/interfered.gd
@@ -0,0 +1,9 @@
+extends Node
+
+const A := preload("res://completion/class_a.notest.gd")
+
+var test := A.new()
+
+func a():
+ test.➡
+ pass
diff --git a/modules/gdscript/tests/scripts/completion/types/member/no_type.cfg b/modules/gdscript/tests/scripts/completion/types/member/no_type.cfg
new file mode 100644
index 0000000000..8b68d51a89
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/member/no_type.cfg
@@ -0,0 +1,12 @@
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/types/member/no_type.gd b/modules/gdscript/tests/scripts/completion/types/member/no_type.gd
new file mode 100644
index 0000000000..9bb9549e97
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/member/no_type.gd
@@ -0,0 +1,9 @@
+extends Node
+
+const A := preload("res://completion/class_a.notest.gd")
+
+var test = A.new()
+
+func a():
+ test.➡
+ pass
diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint.cfg b/modules/gdscript/tests/scripts/completion/types/member/typehint.cfg
new file mode 100644
index 0000000000..8b68d51a89
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/member/typehint.cfg
@@ -0,0 +1,12 @@
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint.gd b/modules/gdscript/tests/scripts/completion/types/member/typehint.gd
new file mode 100644
index 0000000000..7763a2e898
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/member/typehint.gd
@@ -0,0 +1,9 @@
+extends Node
+
+const A := preload("res://completion/class_a.notest.gd")
+
+var test: A
+
+func a():
+ test.➡
+ pass
diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.cfg b/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.cfg
new file mode 100644
index 0000000000..81401316ec
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.cfg
@@ -0,0 +1,13 @@
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+]
+exclude=[
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.gd b/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.gd
new file mode 100644
index 0000000000..a8506705a1
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.gd
@@ -0,0 +1,9 @@
+extends Node
+
+const A := preload("res://completion/class_a.notest.gd")
+
+var test: Node = A.new()
+
+func a():
+ test.➡
+ pass
diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.cfg b/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.cfg
new file mode 100644
index 0000000000..8b68d51a89
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.cfg
@@ -0,0 +1,12 @@
+[output]
+include=[
+ ; Node
+ {"display": "add_child"},
+ {"display": "owner"},
+ {"display": "child_entered_tree"},
+
+ ; GDScript: class_a.notest.gd
+ {"display": "property_of_a"},
+ {"display": "func_of_a"},
+ {"display": "signal_of_a"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.gd b/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.gd
new file mode 100644
index 0000000000..8b5a80cfb3
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.gd
@@ -0,0 +1,9 @@
+extends Node
+
+const A := preload("res://completion/class_a.notest.gd")
+
+var test: A = Node.new()
+
+func a():
+ test.➡
+ pass