summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/runtime/errors
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime/errors')
-rw-r--r--modules/gdscript/tests/scripts/runtime/errors/constant_array_is_deep.out2
-rw-r--r--modules/gdscript/tests/scripts/runtime/errors/constant_dictionary_is_deep.out2
-rw-r--r--modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.gd4
-rw-r--r--modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.out6
4 files changed, 12 insertions, 2 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/errors/constant_array_is_deep.out b/modules/gdscript/tests/scripts/runtime/errors/constant_array_is_deep.out
index c524a1ae6b..350d5d1d45 100644
--- a/modules/gdscript/tests/scripts/runtime/errors/constant_array_is_deep.out
+++ b/modules/gdscript/tests/scripts/runtime/errors/constant_array_is_deep.out
@@ -3,4 +3,4 @@ GDTEST_RUNTIME_ERROR
>> on function: test()
>> runtime/errors/constant_array_is_deep.gd
>> 6
->> Invalid assignment of property or key '0' with value of type 'int' on a base object of type 'Dictionary'.
+>> Invalid assignment on read-only value (on base: 'Dictionary').
diff --git a/modules/gdscript/tests/scripts/runtime/errors/constant_dictionary_is_deep.out b/modules/gdscript/tests/scripts/runtime/errors/constant_dictionary_is_deep.out
index cf51b0262d..5f1f372b0a 100644
--- a/modules/gdscript/tests/scripts/runtime/errors/constant_dictionary_is_deep.out
+++ b/modules/gdscript/tests/scripts/runtime/errors/constant_dictionary_is_deep.out
@@ -3,4 +3,4 @@ GDTEST_RUNTIME_ERROR
>> on function: test()
>> runtime/errors/constant_dictionary_is_deep.gd
>> 6
->> Invalid assignment of index '0' (on base: 'Array') with value of type 'int'.
+>> Invalid assignment on read-only value (on base: 'Array').
diff --git a/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.gd b/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.gd
new file mode 100644
index 0000000000..2f31ecc52f
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.gd
@@ -0,0 +1,4 @@
+func test():
+ var dictionary := { "a": 0 }
+ dictionary.make_read_only()
+ dictionary.a = 1
diff --git a/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.out b/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.out
new file mode 100644
index 0000000000..f7d531e119
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/errors/read_only_dictionary.out
@@ -0,0 +1,6 @@
+GDTEST_RUNTIME_ERROR
+>> SCRIPT ERROR
+>> on function: test()
+>> runtime/errors/read_only_dictionary.gd
+>> 4
+>> Invalid assignment on read-only value (on base: 'Dictionary').