feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -25,7 +25,7 @@ func test():
|
|||
print("String in Array[StringName]: ", "abc" in stringname_array)
|
||||
|
||||
var packed_string_array: PackedStringArray = []
|
||||
assert(!packed_string_array.push_back("abc"))
|
||||
Utils.check(!packed_string_array.push_back("abc"))
|
||||
print("StringName in PackedStringArray: ", &"abc" in packed_string_array)
|
||||
|
||||
string_array.push_back("abc")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# https://github.com/godotengine/godot/issues/75832
|
||||
|
||||
@warning_ignore("narrowing_conversion")
|
||||
@warning_ignore_start("narrowing_conversion")
|
||||
func test():
|
||||
var hf := 2.0
|
||||
var sf = 2.0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
GDTEST_OK
|
||||
>> WARNING
|
||||
>> Line: 4
|
||||
>> REDUNDANT_AWAIT
|
||||
>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal.
|
||||
~~ WARNING at line 4: (REDUNDANT_AWAIT) "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal.
|
||||
awaited
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
GDTEST_OK
|
||||
{ 1: (2, 0) }
|
||||
{ 3: (4, 0) }
|
||||
[[(5, 0)]]
|
||||
[[(6, 0)]]
|
||||
[[(7, 0)]]
|
||||
[X: (8, 9, 7), Y: (0, 1, 0), Z: (0, 0, 1), O: (0, 0, 0)]
|
||||
{ 1: (2.0, 0.0) }
|
||||
{ 3: (4.0, 0.0) }
|
||||
[[(5.0, 0.0)]]
|
||||
[[(6.0, 0.0)]]
|
||||
[[(7.0, 0.0)]]
|
||||
[X: (8.0, 9.0, 7.0), Y: (0.0, 1.0, 0.0), Z: (0.0, 0.0, 1.0), O: (0.0, 0.0, 0.0)]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
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 }')
|
||||
Utils.check(array.is_read_only() == true)
|
||||
Utils.check(str(array) == '[0]')
|
||||
Utils.check(dictionary.is_read_only() == true)
|
||||
Utils.check(str(dictionary) == '{ 1: 2 }')
|
||||
print('ok')
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
GDTEST_OK
|
||||
x is 1
|
||||
x is 1.0
|
||||
typeof x is 3
|
||||
x is 2
|
||||
x is 2.0
|
||||
typeof x is 3
|
||||
x is 3
|
||||
x is 3.0
|
||||
typeof x is 3
|
||||
ok
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ class Foo extends Node:
|
|||
func _init():
|
||||
name = 'f'
|
||||
var string: String = name
|
||||
assert(typeof(string) == TYPE_STRING)
|
||||
assert(string == 'f')
|
||||
Utils.check(typeof(string) == TYPE_STRING)
|
||||
Utils.check(string == 'f')
|
||||
print('ok')
|
||||
|
||||
func test():
|
||||
|
|
|
|||
|
|
@ -6,15 +6,15 @@ extends Node
|
|||
@onready var later_untyped = [1]
|
||||
|
||||
func test():
|
||||
assert(typeof(later_inferred) == TYPE_ARRAY)
|
||||
assert(later_inferred.size() == 0)
|
||||
Utils.check(typeof(later_inferred) == TYPE_ARRAY)
|
||||
Utils.check(later_inferred.size() == 0)
|
||||
|
||||
assert(typeof(later_static) == TYPE_ARRAY)
|
||||
assert(later_static.size() == 0)
|
||||
Utils.check(typeof(later_static) == TYPE_ARRAY)
|
||||
Utils.check(later_static.size() == 0)
|
||||
|
||||
assert(typeof(later_static_with_init) == TYPE_ARRAY)
|
||||
assert(later_static_with_init.size() == 0)
|
||||
Utils.check(typeof(later_static_with_init) == TYPE_ARRAY)
|
||||
Utils.check(later_static_with_init.size() == 0)
|
||||
|
||||
assert(typeof(later_untyped) == TYPE_NIL)
|
||||
Utils.check(typeof(later_untyped) == TYPE_NIL)
|
||||
|
||||
print("ok")
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ func test():
|
|||
stringname_dict[&"abc"] = 24
|
||||
|
||||
print("String key is TYPE_STRING: ", typeof(string_dict.keys()[0]) == TYPE_STRING)
|
||||
print("StringName key is TYPE_STRING: ", typeof(stringname_dict.keys()[0]) == TYPE_STRING)
|
||||
print("StringName key is TYPE_STRING_NAME: ", typeof(stringname_dict.keys()[0]) == TYPE_STRING_NAME)
|
||||
|
||||
print("StringName gets String: ", string_dict.get(&"abc"))
|
||||
print("String gets StringName: ", stringname_dict.get("abc"))
|
||||
|
||||
stringname_dict[&"abc"] = 42
|
||||
# They compare equal because StringName keys are converted to String.
|
||||
# They compare equal because StringName keys are considered equivalent to String keys.
|
||||
print("String Dictionary == StringName Dictionary: ", string_dict == stringname_dict)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
GDTEST_OK
|
||||
String key is TYPE_STRING: true
|
||||
StringName key is TYPE_STRING: true
|
||||
StringName key is TYPE_STRING_NAME: true
|
||||
StringName gets String: 42
|
||||
String gets StringName: 24
|
||||
String Dictionary == StringName Dictionary: true
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
const Utils = preload("../../utils.notest.gd")
|
||||
|
||||
# GH-73843
|
||||
@export_group("Resource")
|
||||
|
||||
|
|
|
|||
|
|
@ -28,13 +28,18 @@ func test():
|
|||
prints(var_to_str(e), var_to_str(elem))
|
||||
|
||||
print("Test String-keys dictionary.")
|
||||
var d1 := {a = 1, b = 2, c = 3}
|
||||
var d1 := { a = 1, b = 2, c = 3 }
|
||||
for k: StringName in d1:
|
||||
var key := k
|
||||
prints(var_to_str(k), var_to_str(key))
|
||||
|
||||
print("Test RefCounted-keys dictionary.")
|
||||
var d2 := {RefCounted.new(): 1, Resource.new(): 2, ConfigFile.new(): 3}
|
||||
var d2 := { RefCounted.new(): 1, Resource.new(): 2, ConfigFile.new(): 3 }
|
||||
for k: RefCounted in d2:
|
||||
var key := k
|
||||
prints(k.get_class(), key.get_class())
|
||||
|
||||
print("Test implicitly typed dictionary literal.")
|
||||
for k: StringName in { x = 123, y = 456, z = 789 }:
|
||||
var key := k
|
||||
prints(var_to_str(k), var_to_str(key))
|
||||
|
|
|
|||
|
|
@ -27,3 +27,7 @@ Test RefCounted-keys dictionary.
|
|||
RefCounted RefCounted
|
||||
Resource Resource
|
||||
ConfigFile ConfigFile
|
||||
Test implicitly typed dictionary literal.
|
||||
&"x" &"x"
|
||||
&"y" &"y"
|
||||
&"z" &"z"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
func test():
|
||||
const COLOR = Color8(255, 0.0, false)
|
||||
var false_value := false
|
||||
@warning_ignore("narrowing_conversion")
|
||||
var color = Color8(255, 0.0, false_value)
|
||||
print(var_to_str(COLOR))
|
||||
print(var_to_str(color))
|
||||
|
||||
var string := "Node"
|
||||
var string_name := &"Node"
|
||||
print(type_exists(string))
|
||||
print(type_exists(string_name))
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
GDTEST_OK
|
||||
Color(1, 0, 0, 1)
|
||||
Color(1, 0, 0, 1)
|
||||
true
|
||||
true
|
||||
|
|
@ -62,7 +62,7 @@ func test():
|
|||
0 when side_effect():
|
||||
print("will run the side effect call, but not this")
|
||||
_:
|
||||
assert(global == 1)
|
||||
Utils.check(global == 1)
|
||||
print("side effect only ran once")
|
||||
|
||||
func side_effect():
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ class MyClass:
|
|||
|
||||
enum MyEnum {}
|
||||
|
||||
const Utils = preload("../../utils.notest.gd")
|
||||
|
||||
static var test_static_var_untyped
|
||||
static var test_static_var_weak_null = null
|
||||
static var test_static_var_weak_int = 1
|
||||
|
|
@ -33,6 +31,16 @@ var test_var_hard_array_my_enum: Array[MyEnum]
|
|||
var test_var_hard_array_resource: Array[Resource]
|
||||
var test_var_hard_array_this: Array[TestMemberInfo]
|
||||
var test_var_hard_array_my_class: Array[MyClass]
|
||||
var test_var_hard_dictionary: Dictionary
|
||||
var test_var_hard_dictionary_int_variant: Dictionary[int, Variant]
|
||||
var test_var_hard_dictionary_variant_int: Dictionary[Variant, int]
|
||||
var test_var_hard_dictionary_int_int: Dictionary[int, int]
|
||||
var test_var_hard_dictionary_variant_type: Dictionary[Variant.Type, Variant.Type]
|
||||
var test_var_hard_dictionary_node_process_mode: Dictionary[Node.ProcessMode, Node.ProcessMode]
|
||||
var test_var_hard_dictionary_my_enum: Dictionary[MyEnum, MyEnum]
|
||||
var test_var_hard_dictionary_resource: Dictionary[Resource, Resource]
|
||||
var test_var_hard_dictionary_this: Dictionary[TestMemberInfo, TestMemberInfo]
|
||||
var test_var_hard_dictionary_my_class: Dictionary[MyClass, MyClass]
|
||||
var test_var_hard_resource: Resource
|
||||
var test_var_hard_this: TestMemberInfo
|
||||
var test_var_hard_my_class: MyClass
|
||||
|
|
@ -45,27 +53,19 @@ func test_func_weak_null(): return null
|
|||
func test_func_weak_int(): return 1
|
||||
func test_func_hard_variant() -> Variant: return null
|
||||
func test_func_hard_int() -> int: return 1
|
||||
func test_func_args_1(_a: int, _b: Array[int], _c: int = 1, _d = 2): pass
|
||||
func test_func_args_1(_a: int, _b: Array[int], _c: Dictionary[int, int], _d: int = 1, _e = 2): pass
|
||||
func test_func_args_2(_a = 1, _b = _a, _c = [2], _d = 3): pass
|
||||
|
||||
@warning_ignore_start("unused_signal")
|
||||
signal test_signal_1()
|
||||
signal test_signal_2(a: Variant, b)
|
||||
signal test_signal_3(a: int, b: Array[int])
|
||||
signal test_signal_4(a: Variant.Type, b: Array[Variant.Type])
|
||||
signal test_signal_5(a: MyEnum, b: Array[MyEnum])
|
||||
signal test_signal_6(a: Resource, b: Array[Resource])
|
||||
signal test_signal_7(a: TestMemberInfo, b: Array[TestMemberInfo])
|
||||
signal test_signal_8(a: MyClass, b: Array[MyClass])
|
||||
|
||||
func no_exec():
|
||||
test_signal_1.emit()
|
||||
test_signal_2.emit()
|
||||
test_signal_3.emit()
|
||||
test_signal_4.emit()
|
||||
test_signal_5.emit()
|
||||
test_signal_6.emit()
|
||||
test_signal_7.emit()
|
||||
test_signal_8.emit()
|
||||
signal test_signal_3(a: int, b: Array[int], c: Dictionary[int, int])
|
||||
signal test_signal_4(a: Variant.Type, b: Array[Variant.Type], c: Dictionary[Variant.Type, Variant.Type])
|
||||
signal test_signal_5(a: MyEnum, b: Array[MyEnum], c: Dictionary[MyEnum, MyEnum])
|
||||
signal test_signal_6(a: Resource, b: Array[Resource], c: Dictionary[Resource, Resource])
|
||||
signal test_signal_7(a: TestMemberInfo, b: Array[TestMemberInfo], c: Dictionary[TestMemberInfo, TestMemberInfo])
|
||||
signal test_signal_8(a: MyClass, b: Array[MyClass], c: Dictionary[MyClass, MyClass])
|
||||
@warning_ignore_restore("unused_signal")
|
||||
|
||||
func test():
|
||||
var script: Script = get_script()
|
||||
|
|
|
|||
|
|
@ -23,6 +23,16 @@ var test_var_hard_array_my_enum: Array[TestMemberInfo.MyEnum]
|
|||
var test_var_hard_array_resource: Array[Resource]
|
||||
var test_var_hard_array_this: Array[TestMemberInfo]
|
||||
var test_var_hard_array_my_class: Array[RefCounted]
|
||||
var test_var_hard_dictionary: Dictionary
|
||||
var test_var_hard_dictionary_int_variant: Dictionary[int, Variant]
|
||||
var test_var_hard_dictionary_variant_int: Dictionary[Variant, int]
|
||||
var test_var_hard_dictionary_int_int: Dictionary[int, int]
|
||||
var test_var_hard_dictionary_variant_type: Dictionary[Variant.Type, Variant.Type]
|
||||
var test_var_hard_dictionary_node_process_mode: Dictionary[Node.ProcessMode, Node.ProcessMode]
|
||||
var test_var_hard_dictionary_my_enum: Dictionary[TestMemberInfo.MyEnum, TestMemberInfo.MyEnum]
|
||||
var test_var_hard_dictionary_resource: Dictionary[Resource, Resource]
|
||||
var test_var_hard_dictionary_this: Dictionary[TestMemberInfo, TestMemberInfo]
|
||||
var test_var_hard_dictionary_my_class: Dictionary[RefCounted, RefCounted]
|
||||
var test_var_hard_resource: Resource
|
||||
var test_var_hard_this: TestMemberInfo
|
||||
var test_var_hard_my_class: RefCounted
|
||||
|
|
@ -33,13 +43,13 @@ func test_func_weak_null() -> Variant
|
|||
func test_func_weak_int() -> Variant
|
||||
func test_func_hard_variant() -> Variant
|
||||
func test_func_hard_int() -> int
|
||||
func test_func_args_1(_a: int, _b: Array[int], _c: int = 1, _d: Variant = 2) -> void
|
||||
func test_func_args_1(_a: int, _b: Array[int], _c: Dictionary[int, int], _d: int = 1, _e: Variant = 2) -> void
|
||||
func test_func_args_2(_a: Variant = 1, _b: Variant = null, _c: Variant = null, _d: Variant = 3) -> void
|
||||
signal test_signal_1()
|
||||
signal test_signal_2(a: Variant, b: Variant)
|
||||
signal test_signal_3(a: int, b: Array[int])
|
||||
signal test_signal_4(a: Variant.Type, b: Array[Variant.Type])
|
||||
signal test_signal_5(a: TestMemberInfo.MyEnum, b: Array[TestMemberInfo.MyEnum])
|
||||
signal test_signal_6(a: Resource, b: Array[Resource])
|
||||
signal test_signal_7(a: TestMemberInfo, b: Array[TestMemberInfo])
|
||||
signal test_signal_8(a: RefCounted, b: Array[RefCounted])
|
||||
signal test_signal_3(a: int, b: Array[int], c: Dictionary[int, int])
|
||||
signal test_signal_4(a: Variant.Type, b: Array[Variant.Type], c: Dictionary[Variant.Type, Variant.Type])
|
||||
signal test_signal_5(a: TestMemberInfo.MyEnum, b: Array[TestMemberInfo.MyEnum], c: Dictionary[TestMemberInfo.MyEnum, TestMemberInfo.MyEnum])
|
||||
signal test_signal_6(a: Resource, b: Array[Resource], c: Dictionary[Resource, Resource])
|
||||
signal test_signal_7(a: TestMemberInfo, b: Array[TestMemberInfo], c: Dictionary[TestMemberInfo, TestMemberInfo])
|
||||
signal test_signal_8(a: RefCounted, b: Array[RefCounted], c: Dictionary[RefCounted, RefCounted])
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
# GH-82169
|
||||
|
||||
const Utils = preload("../../utils.notest.gd")
|
||||
|
||||
class A:
|
||||
static var test_static_var_a1
|
||||
static var test_static_var_a2
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ class MyClass:
|
|||
|
||||
enum MyEnum {A, B, C}
|
||||
|
||||
const Utils = preload("../../utils.notest.gd")
|
||||
const Other = preload("./metatypes.notest.gd")
|
||||
|
||||
var test_native := JSON
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
func get_parse_string(t: Variant):
|
||||
return t.parse_string
|
||||
|
||||
func test():
|
||||
var a: Callable = JSON.parse_string
|
||||
var b: Callable = get_parse_string(JSON)
|
||||
prints(a.call("{\"test\": \"a\"}"), a.is_valid())
|
||||
prints(b.call("{\"test\": \"b\"}"), b.is_valid())
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
GDTEST_OK
|
||||
{ "test": "a" } false
|
||||
{ "test": "b" } false
|
||||
|
|
@ -1,17 +1,11 @@
|
|||
GDTEST_OK
|
||||
>> WARNING
|
||||
>> Line: 5
|
||||
>> SHADOWED_VARIABLE
|
||||
>> The local function parameter "a" is shadowing an already-declared variable at line 3.
|
||||
>> WARNING
|
||||
>> Line: 15
|
||||
>> SHADOWED_VARIABLE
|
||||
>> The local function parameter "v" is shadowing an already-declared variable at line 13.
|
||||
~~ WARNING at line 5: (SHADOWED_VARIABLE) The local function parameter "a" is shadowing an already-declared variable at line 3 in the current class.
|
||||
~~ WARNING at line 15: (SHADOWED_VARIABLE) The local function parameter "v" is shadowing an already-declared variable at line 13 in the current class.
|
||||
a
|
||||
1
|
||||
b
|
||||
1
|
||||
(1, 1)
|
||||
(0, 0)
|
||||
(6, 1)
|
||||
(0, 0)
|
||||
(1.0, 1.0)
|
||||
(0.0, 0.0)
|
||||
(6.0, 1.0)
|
||||
(0.0, 0.0)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
# https://github.com/godotengine/godot/issues/75658
|
||||
|
||||
class MyObj:
|
||||
var callable: Callable
|
||||
|
||||
func run():
|
||||
callable.call()
|
||||
|
||||
var prop:
|
||||
set(value):
|
||||
callable.call()
|
||||
get:
|
||||
callable.call()
|
||||
return 0
|
||||
|
||||
func _on_some_signal():
|
||||
callable.call()
|
||||
|
||||
func _init(p_callable: Callable):
|
||||
self.callable = p_callable
|
||||
|
||||
signal some_signal
|
||||
|
||||
var obj: MyObj
|
||||
|
||||
func test():
|
||||
# Call.
|
||||
obj = MyObj.new(nullify_obj)
|
||||
obj.run()
|
||||
print(obj)
|
||||
|
||||
# Get.
|
||||
obj = MyObj.new(nullify_obj)
|
||||
var _aux = obj.prop
|
||||
print(obj)
|
||||
|
||||
# Set.
|
||||
obj = MyObj.new(nullify_obj)
|
||||
obj.prop = 1
|
||||
print(obj)
|
||||
|
||||
# Signal handling.
|
||||
obj = MyObj.new(nullify_obj)
|
||||
@warning_ignore("return_value_discarded")
|
||||
some_signal.connect(obj._on_some_signal)
|
||||
some_signal.emit()
|
||||
print(obj)
|
||||
|
||||
func nullify_obj():
|
||||
obj = null
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
GDTEST_OK
|
||||
<null>
|
||||
<null>
|
||||
<null>
|
||||
<null>
|
||||
|
|
@ -6,6 +6,6 @@ class MyObj:
|
|||
func test():
|
||||
var obj_1 = MyObj.new()
|
||||
var obj_2 = MyObj.new()
|
||||
assert(obj_2.get_reference_count() == 1)
|
||||
Utils.check(obj_2.get_reference_count() == 1)
|
||||
obj_1.set(&"obj", obj_2)
|
||||
assert(obj_2.get_reference_count() == 1)
|
||||
Utils.check(obj_2.get_reference_count() == 1)
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
GDTEST_OK
|
||||
===
|
||||
prop1 setter (0, 0)
|
||||
prop1 setter (1, 0)
|
||||
prop1 setter (0.0, 0.0)
|
||||
prop1 setter (1.0, 0.0)
|
||||
---
|
||||
prop1 setter <Inner>
|
||||
subprop getter
|
||||
subprop setter (1, 0)
|
||||
subprop setter (1.0, 0.0)
|
||||
===
|
||||
prop2 setter <Inner>
|
||||
subprop getter
|
||||
subprop setter (1, 0)
|
||||
subprop setter (1.0, 0.0)
|
||||
===
|
||||
prop3 setter (0, 0)
|
||||
prop3 setter (0.0, 0.0)
|
||||
prop3 getter
|
||||
prop3 setter (1, 0)
|
||||
prop3 setter (1.0, 0.0)
|
||||
---
|
||||
prop3 setter <Inner>
|
||||
prop3 getter
|
||||
subprop getter
|
||||
subprop setter (1, 0)
|
||||
subprop setter (1.0, 0.0)
|
||||
===
|
||||
prop4 setter <Inner>
|
||||
prop4 getter
|
||||
subprop getter
|
||||
subprop setter (1, 0)
|
||||
subprop setter (1.0, 0.0)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
GDTEST_OK
|
||||
setting vec from (0, 0) to (2, 0)
|
||||
setting vec from (0, 0) to (0, 2)
|
||||
vec is (0, 0)
|
||||
setting vec from (0.0, 0.0) to (2.0, 0.0)
|
||||
setting vec from (0.0, 0.0) to (0.0, 2.0)
|
||||
vec is (0.0, 0.0)
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@ func test() -> void:
|
|||
node1.add_child(node2)
|
||||
add_child(node3)
|
||||
|
||||
assert(get_node("_/Child") == $_/Child)
|
||||
Utils.check(get_node("_/Child") == $_/Child)
|
||||
|
|
|
|||
|
|
@ -14,33 +14,33 @@ func test():
|
|||
func test_construct(v, f):
|
||||
@warning_ignore("unsafe_call_argument")
|
||||
Vector2(v, v) # Built-in type construct.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
Utils.check(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_utility(v, f):
|
||||
abs(v) # Utility function.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
Utils.check(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_builtin_call(v, f):
|
||||
@warning_ignore("unsafe_method_access")
|
||||
v.angle() # Built-in method call.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
Utils.check(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_builtin_call_validated(v: Vector2, f):
|
||||
@warning_ignore("return_value_discarded")
|
||||
v.abs() # Built-in method call validated.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
Utils.check(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_object_call(v, f):
|
||||
@warning_ignore("unsafe_method_access")
|
||||
v.get_reference_count() # Native type method call.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
Utils.check(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_object_call_method_bind(v: Resource, f):
|
||||
@warning_ignore("return_value_discarded")
|
||||
v.duplicate() # Native type method call with MethodBind.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
Utils.check(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_object_call_method_bind_validated(v: RefCounted, f):
|
||||
@warning_ignore("return_value_discarded")
|
||||
v.get_reference_count() # Native type method call with validated MethodBind.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
Utils.check(not f) # Test unary operator reading from `nil`.
|
||||
|
|
|
|||
|
|
@ -4,21 +4,25 @@ func test():
|
|||
print(-1.25, 0.25, 1.25)
|
||||
print("hello world")
|
||||
|
||||
print(Vector2(0.25, 0.25))
|
||||
print(Vector2(0.25, 1))
|
||||
print(Vector2i(0, 0))
|
||||
|
||||
print(Rect2(0.25, 0.25, 0.5, 0.5))
|
||||
print(Rect2(0.25, 0.25, 0.5, 1))
|
||||
print(Rect2i(0, 0, 0, 0))
|
||||
|
||||
print(Vector3(0.25, 0.25, 0.25))
|
||||
print(Vector3(0.25, 0.25, 1))
|
||||
print(Vector3i(0, 0, 0))
|
||||
|
||||
print(Vector4(0.25, 0.25, 0.25, 1))
|
||||
print(Vector4i(0, 0, 0, 0))
|
||||
|
||||
print(Transform2D.IDENTITY)
|
||||
print(Plane(1, 2, 3, 4))
|
||||
print(Quaternion(1, 2, 3, 4))
|
||||
print(AABB(Vector3.ZERO, Vector3.ONE))
|
||||
print(Basis.from_euler(Vector3(0, 0, 0)))
|
||||
print(Transform3D.IDENTITY)
|
||||
print(Projection.IDENTITY)
|
||||
|
||||
print(Color(1, 2, 3, 4))
|
||||
print(StringName("hello"))
|
||||
|
|
|
|||
|
|
@ -3,19 +3,22 @@ truefalse
|
|||
-101
|
||||
-1.250.251.25
|
||||
hello world
|
||||
(0.25, 0.25)
|
||||
(0.25, 1.0)
|
||||
(0, 0)
|
||||
[P: (0.25, 0.25), S: (0.5, 0.5)]
|
||||
[P: (0.25, 0.25), S: (0.5, 1.0)]
|
||||
[P: (0, 0), S: (0, 0)]
|
||||
(0.25, 0.25, 0.25)
|
||||
(0.25, 0.25, 1.0)
|
||||
(0, 0, 0)
|
||||
[X: (1, 0), Y: (0, 1), O: (0, 0)]
|
||||
[N: (1, 2, 3), D: 4]
|
||||
(1, 2, 3, 4)
|
||||
[P: (0, 0, 0), S: (1, 1, 1)]
|
||||
[X: (1, 0, 0), Y: (0, 1, 0), Z: (0, 0, 1)]
|
||||
[X: (1, 0, 0), Y: (0, 1, 0), Z: (0, 0, 1), O: (0, 0, 0)]
|
||||
(0.25, 0.25, 0.25, 1.0)
|
||||
(0, 0, 0, 0)
|
||||
[X: (1.0, 0.0), Y: (0.0, 1.0), O: (0.0, 0.0)]
|
||||
[N: (1.0, 2.0, 3.0), D: 4]
|
||||
(1, 2, 3, 4)
|
||||
[P: (0.0, 0.0, 0.0), S: (1.0, 1.0, 1.0)]
|
||||
[X: (1.0, 0.0, 0.0), Y: (0.0, 1.0, 0.0), Z: (0.0, 0.0, 1.0)]
|
||||
[X: (1.0, 0.0, 0.0), Y: (0.0, 1.0, 0.0), Z: (0.0, 0.0, 1.0), O: (0.0, 0.0, 0.0)]
|
||||
[X: (1.0, 0.0, 0.0, 0.0), Y: (0.0, 1.0, 0.0, 0.0), Z: (0.0, 0.0, 1.0, 0.0), W: (0.0, 0.0, 0.0, 1.0)]
|
||||
(1.0, 2.0, 3.0, 4.0)
|
||||
hello
|
||||
hello/world
|
||||
RID(0)
|
||||
|
|
@ -26,10 +29,10 @@ Node::[signal]property_list_changed
|
|||
[255, 0, 1]
|
||||
[-1, 0, 1]
|
||||
[-1, 0, 1]
|
||||
[-1, 0, 1]
|
||||
[-1, 0, 1]
|
||||
[-1.0, 0.0, 1.0]
|
||||
[-1.0, 0.0, 1.0]
|
||||
["hello", "world"]
|
||||
[(1, 1), (0, 0)]
|
||||
[(1, 1, 1), (0, 0, 0)]
|
||||
[(1, 0, 0, 1), (0, 0, 1, 1), (0, 1, 0, 1)]
|
||||
[(1, 1, 1, 1), (0, 0, 0, 0)]
|
||||
[(1.0, 1.0), (0.0, 0.0)]
|
||||
[(1.0, 1.0, 1.0), (0.0, 0.0, 0.0)]
|
||||
[(1.0, 0.0, 0.0, 1.0), (0.0, 0.0, 1.0, 1.0), (0.0, 1.0, 0.0, 1.0)]
|
||||
[(1.0, 1.0, 1.0, 1.0), (0.0, 0.0, 0.0, 0.0)]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
func test():
|
||||
var untyped: Variant = 32
|
||||
var typed: Array[int] = [untyped]
|
||||
assert(typed.get_typed_builtin() == TYPE_INT)
|
||||
assert(str(typed) == '[32]')
|
||||
Utils.check(typed.get_typed_builtin() == TYPE_INT)
|
||||
Utils.check(str(typed) == '[32]')
|
||||
print('ok')
|
||||
|
|
|
|||
|
|
@ -1,12 +1,6 @@
|
|||
GDTEST_OK
|
||||
>> WARNING
|
||||
>> Line: 6
|
||||
>> NARROWING_CONVERSION
|
||||
>> Narrowing conversion (float is converted to int and loses precision).
|
||||
>> WARNING
|
||||
>> Line: 8
|
||||
>> NARROWING_CONVERSION
|
||||
>> Narrowing conversion (float is converted to int and loses precision).
|
||||
~~ WARNING at line 6: (NARROWING_CONVERSION) Narrowing conversion (float is converted to int and loses precision).
|
||||
~~ WARNING at line 8: (NARROWING_CONVERSION) Narrowing conversion (float is converted to int and loses precision).
|
||||
2
|
||||
2
|
||||
2
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
func test_param(dictionary: Dictionary[int, String]) -> void:
|
||||
print(dictionary.get_typed_key_builtin() == TYPE_INT)
|
||||
print(dictionary.get_typed_value_builtin() == TYPE_STRING)
|
||||
|
||||
func test() -> void:
|
||||
test_param({ 123: "some_string" })
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
GDTEST_OK
|
||||
true
|
||||
true
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
func test():
|
||||
var untyped: Variant = 32
|
||||
var typed: Dictionary[int, int] = { untyped: untyped }
|
||||
Utils.check(typed.get_typed_key_builtin() == TYPE_INT)
|
||||
Utils.check(typed.get_typed_value_builtin() == TYPE_INT)
|
||||
Utils.check(str(typed) == '{ 32: 32 }')
|
||||
print('ok')
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_OK
|
||||
ok
|
||||
Loading…
Add table
Add a link
Reference in a new issue