Skip to content

Commit a874eb1

Browse files
committed
Add TestNode to tests
1 parent 6b6ad67 commit a874eb1

File tree

7 files changed

+46
-4
lines changed

7 files changed

+46
-4
lines changed

test/godot_project/gdscript/Test.gd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ func _init():
55
TestAll.test();
66

77
func _ready():
8-
get_tree().quit(0);
8+
call_deferred("quit");
9+
10+
func quit(): pass
11+
# quits too soon for some reason?? Fix later
12+
# get_tree().quit(0);

test/godot_project/gdscript/out/TestClass.gd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ static func test() -> void:
2121
"className": "test.TestClass",
2222
"methodName": "test"
2323
})
24-
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extends Node
2+
class_name TestNode
3+
4+
@export
5+
var dictionary: Dictionary[String, String] = {}
6+
7+
func _init() -> void:
8+
self.dictionary = {}
9+
10+
func _ready() -> void:
11+
Log.trace.call(self.dictionary, {
12+
"fileName": "src/test/TestNode.hx",
13+
"lineNumber": 11,
14+
"className": "test.TestNode",
15+
"methodName": "_ready"
16+
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://cx1b4may35vuv

test/godot_project/gdscript/out/_GeneratedFiles.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version // 1
2-
0//0
2+
0//1
33
test_TestStd_C.gd
44
test_TestStd_B.gd
55
test_TestStd_A.gd
@@ -16,6 +16,7 @@ TestStd.gd
1616
TestStaticVar.gd
1717
TestSignals.gd
1818
TestReflect.gd
19+
TestNode.gd
1920
TestMeta.gd
2021
TestMath.gd
2122
TestEnum.gd

test/godot_project/test_scene.tscn

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
[gd_scene load_steps=2 format=3 uid="uid://b2ov0mlfa2u6n"]
1+
[gd_scene load_steps=3 format=3 uid="uid://b2ov0mlfa2u6n"]
22

33
[ext_resource type="Script" uid="uid://ct7urpn1juqu1" path="res://gdscript/Test.gd" id="1_s5uoa"]
4+
[ext_resource type="Script" uid="uid://cx1b4may35vuv" path="res://gdscript/out/TestNode.gd" id="2_ia1lp"]
45

56
[node name="Node2D" type="Node2D"]
67
script = ExtResource("1_s5uoa")
8+
9+
[node name="TestNode" type="Node" parent="."]
10+
script = ExtResource("2_ia1lp")
11+
dictionary = Dictionary[String, String]({
12+
"What is this?": "This is a added in editor! Success!!"
13+
})
14+
metadata/_custom_type_script = "uid://cx1b4may35vuv"

test/src/test/TestNode.hx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package test;
2+
3+
extern class Node {
4+
function _ready(): Void;
5+
}
6+
7+
class TestNode extends Node {
8+
@:export var dictionary = new gdscript.Dictionary<String, String>();
9+
10+
override function _ready() {
11+
trace(dictionary); // Check that this matches what's placed in editor.
12+
}
13+
}

0 commit comments

Comments
 (0)