|
@@ -102,6 +102,7 @@ func _ready():
|
|
# mp_callable() with void method.
|
|
# mp_callable() with void method.
|
|
var mp_callable: Callable = example.test_callable_mp()
|
|
var mp_callable: Callable = example.test_callable_mp()
|
|
assert_equal(mp_callable.is_valid(), true)
|
|
assert_equal(mp_callable.is_valid(), true)
|
|
|
|
+ assert_equal(mp_callable.get_argument_count(), 3)
|
|
mp_callable.call(example, "void", 36)
|
|
mp_callable.call(example, "void", 36)
|
|
assert_equal(custom_signal_emitted, ["unbound_method1: Example - void", 36])
|
|
assert_equal(custom_signal_emitted, ["unbound_method1: Example - void", 36])
|
|
|
|
|
|
@@ -117,14 +118,17 @@ func _ready():
|
|
|
|
|
|
# mp_callable() with return value.
|
|
# mp_callable() with return value.
|
|
var mp_callable_ret: Callable = example.test_callable_mp_ret()
|
|
var mp_callable_ret: Callable = example.test_callable_mp_ret()
|
|
|
|
+ assert_equal(mp_callable_ret.get_argument_count(), 3)
|
|
assert_equal(mp_callable_ret.call(example, "test", 77), "unbound_method2: Example - test - 77")
|
|
assert_equal(mp_callable_ret.call(example, "test", 77), "unbound_method2: Example - test - 77")
|
|
|
|
|
|
# mp_callable() with const method and return value.
|
|
# mp_callable() with const method and return value.
|
|
var mp_callable_retc: Callable = example.test_callable_mp_retc()
|
|
var mp_callable_retc: Callable = example.test_callable_mp_retc()
|
|
|
|
+ assert_equal(mp_callable_retc.get_argument_count(), 3)
|
|
assert_equal(mp_callable_retc.call(example, "const", 101), "unbound_method3: Example - const - 101")
|
|
assert_equal(mp_callable_retc.call(example, "const", 101), "unbound_method3: Example - const - 101")
|
|
|
|
|
|
# mp_callable_static() with void method.
|
|
# mp_callable_static() with void method.
|
|
var mp_callable_static: Callable = example.test_callable_mp_static()
|
|
var mp_callable_static: Callable = example.test_callable_mp_static()
|
|
|
|
+ assert_equal(mp_callable_static.get_argument_count(), 3)
|
|
mp_callable_static.call(example, "static", 83)
|
|
mp_callable_static.call(example, "static", 83)
|
|
assert_equal(custom_signal_emitted, ["unbound_static_method1: Example - static", 83])
|
|
assert_equal(custom_signal_emitted, ["unbound_static_method1: Example - static", 83])
|
|
|
|
|
|
@@ -140,6 +144,7 @@ func _ready():
|
|
|
|
|
|
# mp_callable_static() with return value.
|
|
# mp_callable_static() with return value.
|
|
var mp_callable_static_ret: Callable = example.test_callable_mp_static_ret()
|
|
var mp_callable_static_ret: Callable = example.test_callable_mp_static_ret()
|
|
|
|
+ assert_equal(mp_callable_static_ret.get_argument_count(), 3)
|
|
assert_equal(mp_callable_static_ret.call(example, "static-ret", 84), "unbound_static_method2: Example - static-ret - 84")
|
|
assert_equal(mp_callable_static_ret.call(example, "static-ret", 84), "unbound_static_method2: Example - static-ret - 84")
|
|
|
|
|
|
# CallableCustom.
|
|
# CallableCustom.
|
|
@@ -150,6 +155,7 @@ func _ready():
|
|
assert_equal(custom_callable.hash(), 27);
|
|
assert_equal(custom_callable.hash(), 27);
|
|
assert_equal(custom_callable.get_object(), null);
|
|
assert_equal(custom_callable.get_object(), null);
|
|
assert_equal(custom_callable.get_method(), "");
|
|
assert_equal(custom_callable.get_method(), "");
|
|
|
|
+ assert_equal(custom_callable.get_argument_count(), 2)
|
|
assert_equal(str(custom_callable), "<MyCallableCustom>");
|
|
assert_equal(str(custom_callable), "<MyCallableCustom>");
|
|
|
|
|
|
# PackedArray iterators
|
|
# PackedArray iterators
|