From 8eb837dc3dd56f96b4e4733b37359661b88527b5 Mon Sep 17 00:00:00 2001 From: mashumafi Date: Mon, 20 Feb 2023 23:01:32 -0500 Subject: Add test for const class references --- .../scripts/runtime/features/const_class_reference.gd | 16 ++++++++++++++++ .../scripts/runtime/features/const_class_reference.out | 1 + .../features/const_class_reference_external.notest.gd | 2 ++ 3 files changed, 19 insertions(+) create mode 100644 modules/gdscript/tests/scripts/runtime/features/const_class_reference.gd create mode 100644 modules/gdscript/tests/scripts/runtime/features/const_class_reference.out create mode 100644 modules/gdscript/tests/scripts/runtime/features/const_class_reference_external.notest.gd (limited to 'modules/gdscript/tests') diff --git a/modules/gdscript/tests/scripts/runtime/features/const_class_reference.gd b/modules/gdscript/tests/scripts/runtime/features/const_class_reference.gd new file mode 100644 index 0000000000..c7553769da --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/const_class_reference.gd @@ -0,0 +1,16 @@ +# https://github.com/godotengine/godot/issues/61636 + +const External := preload("const_class_reference_external.notest.gd") + +class Class1: + class Class2: + pass + +const Class1Alias = Class1 +const Class1Class2Alias = Class1.Class2 + +const ExternalAlias = External +const ExternalClassAlias = External.Class + +func test(): + pass diff --git a/modules/gdscript/tests/scripts/runtime/features/const_class_reference.out b/modules/gdscript/tests/scripts/runtime/features/const_class_reference.out new file mode 100644 index 0000000000..d73c5eb7cd --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/const_class_reference.out @@ -0,0 +1 @@ +GDTEST_OK diff --git a/modules/gdscript/tests/scripts/runtime/features/const_class_reference_external.notest.gd b/modules/gdscript/tests/scripts/runtime/features/const_class_reference_external.notest.gd new file mode 100644 index 0000000000..050e8a0960 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/const_class_reference_external.notest.gd @@ -0,0 +1,2 @@ +class Class: + pass -- cgit v1.2.3