diff options
Diffstat (limited to 'modules/gdscript/tests/scripts')
3 files changed, 19 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/preload_script_native_type.gd b/modules/gdscript/tests/scripts/analyzer/features/preload_script_native_type.gd new file mode 100644 index 0000000000..25381035b2 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/features/preload_script_native_type.gd @@ -0,0 +1,15 @@ +const Preloaded := preload( 'preload_script_native_type.notest.gd' ) + +func test() -> void: + var inferred := Preloaded.new() + var inferred_owner := inferred.owner + + var typed: Preloaded + typed = Preloaded.new() + var typed_owner := typed.owner + + print(typed_owner == inferred_owner) + + inferred.free() + typed.free() + print('ok') diff --git a/modules/gdscript/tests/scripts/analyzer/features/preload_script_native_type.notest.gd b/modules/gdscript/tests/scripts/analyzer/features/preload_script_native_type.notest.gd new file mode 100644 index 0000000000..61510e14cd --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/features/preload_script_native_type.notest.gd @@ -0,0 +1 @@ +extends Node diff --git a/modules/gdscript/tests/scripts/analyzer/features/preload_script_native_type.out b/modules/gdscript/tests/scripts/analyzer/features/preload_script_native_type.out new file mode 100644 index 0000000000..3e24a1e2af --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/features/preload_script_native_type.out @@ -0,0 +1,3 @@ +GDTEST_OK +true +ok |