summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2023-02-21 07:29:14 +0100
committerGitHub <noreply@github.com>2023-02-21 07:29:14 +0100
commit8af679da826eac05de198abd593325908db355d0 (patch)
tree4bef35f7a22fe534280186a66b5fb5e5efb1cc9f
parentd68cfb43efa3790a71c63610acee7f63ac3d2e00 (diff)
parent8eb837dc3dd56f96b4e4733b37359661b88527b5 (diff)
Merge pull request #73661 from mashumafi/external-class-ref
Add test for const class references
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/const_class_reference.gd16
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/const_class_reference.out1
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/const_class_reference_external.notest.gd2
3 files changed, 19 insertions, 0 deletions
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