-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wrong arguments in callv with const Array
- Loading branch information
Showing
4 changed files
with
87 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
modules/gdscript/tests/scripts/runtime/features/callv_readonly_array.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var array_var: Array = ["one", "two", "three", "four"] | ||
const array_const: Array = ["one", "two", "three", "four"] | ||
|
||
var array_nested_var: Array = [["one"], ["two"], ["three"], ["four"]] | ||
const array_nested_const: Array = [["one"], ["two"], ["three"], ["four"]] | ||
|
||
|
||
func test(): | ||
assert(array_const.is_read_only() == true) | ||
assert(array_nested_const.is_read_only() == true) | ||
|
||
print("TEST Callable::callv") | ||
print_four_variants.callv(array_var) | ||
print_four_variants.callv(array_const) | ||
print_four_variants.callv(array_nested_var) | ||
print_four_variants.callv(array_nested_const) | ||
|
||
print("TEST Object::callv") | ||
self.callv("print_four_variants", array_var) | ||
self.callv("print_four_variants", array_const) | ||
self.callv("print_four_variants", array_nested_var) | ||
self.callv("print_four_variants", array_nested_const) | ||
|
||
|
||
func print_four_variants(v1, v2, v3, v4): | ||
print("%s %s %s %s" % [v1, v2, v3, v4]) |
11 changes: 11 additions & 0 deletions
11
modules/gdscript/tests/scripts/runtime/features/callv_readonly_array.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
GDTEST_OK | ||
TEST Callable::callv | ||
one two three four | ||
one two three four | ||
["one"] ["two"] ["three"] ["four"] | ||
["one"] ["two"] ["three"] ["four"] | ||
TEST Object::callv | ||
one two three four | ||
one two three four | ||
["one"] ["two"] ["three"] ["four"] | ||
["one"] ["two"] ["three"] ["four"] |