summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/runtime/features
diff options
context:
space:
mode:
authorAdam Scott <ascott.ca@gmail.com>2023-01-10 20:08:46 -0500
committerAdam Scott <ascott.ca@gmail.com>2023-01-12 10:27:38 -0500
commite3e55b29cec2dd62f268f24c43c07886378607ad (patch)
tree36d18d4c4db01a14da4bbca943ebcb8ba5e1e61d /modules/gdscript/tests/scripts/runtime/features
parent4ac649d8386b805f5857b545c6404515da25d4f7 (diff)
Add default virtual `gdscript://` path to `GDScript` instances
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime/features')
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/gdscript.gd20
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/gdscript.out3
2 files changed, 23 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/gdscript.gd b/modules/gdscript/tests/scripts/runtime/features/gdscript.gd
new file mode 100644
index 0000000000..f2368643de
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/features/gdscript.gd
@@ -0,0 +1,20 @@
+func test():
+ var gdscr: = GDScript.new()
+ gdscr.source_code = '''
+extends Resource
+
+func test() -> void:
+ prints("Outer")
+ var inner = InnerClass.new()
+
+class InnerClass:
+ func _init() -> void:
+ prints("Inner")
+'''
+ @warning_ignore(return_value_discarded)
+ gdscr.reload()
+
+ var inst = gdscr.new()
+
+ @warning_ignore(unsafe_method_access)
+ inst.test()
diff --git a/modules/gdscript/tests/scripts/runtime/features/gdscript.out b/modules/gdscript/tests/scripts/runtime/features/gdscript.out
new file mode 100644
index 0000000000..16114f57f7
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/features/gdscript.out
@@ -0,0 +1,3 @@
+GDTEST_OK
+Outer
+Inner