diff options
author | Dmitrii Maganov <vonagam@gmail.com> | 2023-01-22 11:07:48 +0200 |
---|---|---|
committer | Dmitrii Maganov <vonagam@gmail.com> | 2023-01-27 05:28:08 +0200 |
commit | abe6d6723219b592829fd9ba2a2c78950c83d64e (patch) | |
tree | 374101c2ae82959906d06c6a573d6cc63f5b0151 /modules/gdscript/tests/scripts/runtime/features | |
parent | d1e5903c67956707948b1de370b807e3aad395b7 (diff) |
GDScript: Fix test for read-only state of constants
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime/features')
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.gd | 10 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.out | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.gd b/modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.gd new file mode 100644 index 0000000000..d1746979be --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.gd @@ -0,0 +1,10 @@ +const array: Array = [0] +const dictionary := {1: 2} + +@warning_ignore("assert_always_true") +func test(): + assert(array.is_read_only() == true) + assert(str(array) == '[0]') + assert(dictionary.is_read_only() == true) + assert(str(dictionary) == '{ 1: 2 }') + print('ok') diff --git a/modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.out b/modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.out new file mode 100644 index 0000000000..1b47ed10dc --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.out @@ -0,0 +1,2 @@ +GDTEST_OK +ok |