Skip to content

Commit

Permalink
Merge pull request #86973 from HolonProduction/tests-batch-1
Browse files Browse the repository at this point in the history
Add tests for `get_node` autocompletion
  • Loading branch information
akien-mga committed Mar 4, 2024
2 parents f289ec9 + a2e7c64 commit 7be96a5
Show file tree
Hide file tree
Showing 72 changed files with 665 additions and 6 deletions.
8 changes: 8 additions & 0 deletions modules/gdscript/tests/scripts/completion/class_a.notest.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends Node

signal signal_of_a

var property_of_a

func func_of_a():
pass
19 changes: 19 additions & 0 deletions modules/gdscript/tests/scripts/completion/get_node/get_node.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[gd_scene load_steps=2 format=3 uid="uid://c8wekfd5ql7bc"]

[ext_resource type="Script" path="res://completion/class_a.notest.gd" id="1_ldc4g"]

[node name="GetNode" type="Node"]

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]

[node name="UniqueNames" type="Node" parent="."]

[node name="UniqueAnimationPlayer" type="AnimationPlayer" parent="UniqueNames"]
unique_name_in_owner = true

[node name="UniqueA" type="Node" parent="UniqueNames"]
unique_name_in_owner = true
script = ExtResource("1_ldc4g")

[node name="A" type="Node" parent="."]
script = ExtResource("1_ldc4g")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Node

func a():
%AnimationPlayer.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Node

func a():
$UniqueAnimationPlayer.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Node

func a():
$A.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
scene="res://completion/get_node/get_node.tscn"
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},

; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
{"display": "animation_changed"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Node

func a():
$AnimationPlayer.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Node

func a():
%UniqueA.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
scene="res://completion/get_node/get_node.tscn"
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},

; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
{"display": "animation_changed"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Node

func a():
%UniqueAnimationPlayer.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends Node

func a():
var test = $AnimationPlayer
test.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends Node

func a():
var test := $AnimationPlayer
test.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends Node

func a():
var test := $A
test.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
scene="res://completion/get_node/get_node.tscn"
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},

; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
{"display": "animation_changed"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends Node

func a():
var test := $AnimationPlayer
test.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends Node

func a():
var test = $A
test.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
scene="res://completion/get_node/get_node.tscn"
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},

; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
{"display": "animation_changed"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends Node

func a():
var test = $AnimationPlayer
test.➡
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

func a():
var test: A = $A
test.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},

; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
{"display": "animation_changed"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends Node

func a():
var test: AnimationPlayer = $AnimationPlayer
test.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

func a():
var test: A = $A
test.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
scene="res://completion/get_node/get_node.tscn"
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},

; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
{"display": "animation_changed"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends Node

func a():
var test: AnimationPlayer = $AnimationPlayer
test.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TODO
extends Node

func a():
var test: Node = $A
test.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[input]
scene="res://completion/get_node/get_node.tscn"
[output]
include=[
; Node
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},

; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
{"display": "animation_changed"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TODO
extends Node

func a():
var test: Node = $AnimationPlayer
test.➡
Loading

0 comments on commit 7be96a5

Please sign in to comment.