summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/tests/scripts')
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.cfg11
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.gd8
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.cfg9
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.gd3
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.cfg11
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.gd8
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.cfg9
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.gd3
-rw-r--r--modules/gdscript/tests/scripts/parser/features/export_variable.gd6
-rw-r--r--modules/gdscript/tests/scripts/parser/features/export_variable.notest.gd2
-rw-r--r--modules/gdscript/tests/scripts/parser/features/export_variable.out4
-rw-r--r--modules/gdscript/tests/scripts/project.godot7
12 files changed, 81 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.cfg b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.cfg
new file mode 100644
index 0000000000..a8f26d83f9
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.cfg
@@ -0,0 +1,11 @@
+[input]
+add_node_path_literals=true
+[output]
+include=[
+ {"insert_text": "^\"property_of_a\""},
+ {"insert_text": "^\"name\""},
+]
+exclude=[
+ {"insert_text": "\"property_of_a\""},
+ {"insert_text": "\"name\""},
+]
diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.gd b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.gd
new file mode 100644
index 0000000000..bfdb5c7995
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.gd
@@ -0,0 +1,8 @@
+extends Node
+
+const A = preload("res://completion/class_a.notest.gd")
+
+func _ready() -> void:
+ var a := A.new()
+ var tween := get_tree().create_tween()
+ tween.tween_property(a, ➡)
diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.cfg b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.cfg
new file mode 100644
index 0000000000..309fa8ed38
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.cfg
@@ -0,0 +1,9 @@
+[input]
+add_string_name_literals=true
+[output]
+include=[
+ {"insert_text": "&\"test_input_action\""},
+]
+exclude=[
+ {"insert_text": "\"test_input_action\""},
+]
diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.gd b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.gd
new file mode 100644
index 0000000000..9b325e632d
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.gd
@@ -0,0 +1,3 @@
+func _input(event: InputEvent) -> void:
+ event.is_action_pressed(➡)
+ pass
diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.cfg b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.cfg
new file mode 100644
index 0000000000..45d0ad0f3b
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.cfg
@@ -0,0 +1,11 @@
+[input]
+add_node_path_literals=false
+[output]
+include=[
+ {"insert_text": "\"property_of_a\""},
+ {"insert_text": "\"name\""},
+]
+exclude=[
+ {"insert_text": "^\"property_of_a\""},
+ {"insert_text": "^\"name\""},
+]
diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.gd b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.gd
new file mode 100644
index 0000000000..bfdb5c7995
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.gd
@@ -0,0 +1,8 @@
+extends Node
+
+const A = preload("res://completion/class_a.notest.gd")
+
+func _ready() -> void:
+ var a := A.new()
+ var tween := get_tree().create_tween()
+ tween.tween_property(a, ➡)
diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.cfg b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.cfg
new file mode 100644
index 0000000000..7a388d54e1
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.cfg
@@ -0,0 +1,9 @@
+[input]
+add_string_name_literals=false
+[output]
+include=[
+ {"insert_text": "\"test_input_action\""},
+]
+exclude=[
+ {"insert_text": "&\"test_input_action\""},
+]
diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.gd b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.gd
new file mode 100644
index 0000000000..9b325e632d
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.gd
@@ -0,0 +1,3 @@
+func _input(event: InputEvent) -> void:
+ event.is_action_pressed(➡)
+ pass
diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.gd b/modules/gdscript/tests/scripts/parser/features/export_variable.gd
index 8b343de5ef..483e6cab0d 100644
--- a/modules/gdscript/tests/scripts/parser/features/export_variable.gd
+++ b/modules/gdscript/tests/scripts/parser/features/export_variable.gd
@@ -1,6 +1,8 @@
+class_name ExportVariableTest
extends Node
const Utils = preload("../../utils.notest.gd")
+const PreloadedScript = preload("./export_variable.notest.gd")
# Built-in types.
@export var test_weak_int = 1
@@ -20,6 +22,10 @@ const Utils = preload("../../utils.notest.gd")
@export var test_image: Image
@export var test_timer: Timer
+# Global custom classes.
+@export var test_global_class: ExportVariableTest
+@export var test_preloaded_script: PreloadedScript
+
# Arrays.
@export var test_array: Array
@export var test_array_bool: Array[bool]
diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.notest.gd b/modules/gdscript/tests/scripts/parser/features/export_variable.notest.gd
new file mode 100644
index 0000000000..6d064351c1
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/features/export_variable.notest.gd
@@ -0,0 +1,2 @@
+class_name ExportPreloadedClassTest
+extends Node
diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.out b/modules/gdscript/tests/scripts/parser/features/export_variable.out
index 99d7b27130..bb094e14b4 100644
--- a/modules/gdscript/tests/scripts/parser/features/export_variable.out
+++ b/modules/gdscript/tests/scripts/parser/features/export_variable.out
@@ -23,6 +23,10 @@ var test_image: Image = null
hint=RESOURCE_TYPE hint_string="Image" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"Image"
var test_timer: Timer = null
hint=NODE_TYPE hint_string="Timer" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"Timer"
+var test_global_class: ExportVariableTest = null
+ hint=NODE_TYPE hint_string="ExportVariableTest" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"ExportVariableTest"
+var test_preloaded_script: ExportPreloadedClassTest = null
+ hint=NODE_TYPE hint_string="ExportPreloadedClassTest" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"ExportPreloadedClassTest"
var test_array: Array = []
hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_array_bool: Array = Array[bool]([])
diff --git a/modules/gdscript/tests/scripts/project.godot b/modules/gdscript/tests/scripts/project.godot
index c500ef443d..c9035ecab9 100644
--- a/modules/gdscript/tests/scripts/project.godot
+++ b/modules/gdscript/tests/scripts/project.godot
@@ -8,3 +8,10 @@ config_version=5
[application]
config/name="GDScript Integration Test Suite"
+
+[input]
+
+test_input_action={
+"deadzone": 0.5,
+"events": []
+}