Merge pull request #1280 from dsnopek/callable-custom

Add `CallableCustom` that devs can use in their GDExtensions
This commit is contained in:
David Snopek
2023-11-17 12:48:39 -06:00
committed by GitHub
12 changed files with 335 additions and 53 deletions

View File

@@ -121,6 +121,16 @@ func _ready():
var mp_callable_static_ret: Callable = example.test_callable_mp_static_ret()
assert_equal(mp_callable_static_ret.call(example, "static-ret", 84), "unbound_static_method2: Example - static-ret - 84")
# CallableCustom.
var custom_callable: Callable = example.test_custom_callable();
assert_equal(custom_callable.is_custom(), true);
assert_equal(custom_callable.is_valid(), true);
assert_equal(custom_callable.call(), "Hi")
assert_equal(custom_callable.hash(), 27);
assert_equal(custom_callable.get_object(), null);
assert_equal(custom_callable.get_method(), "");
assert_equal(str(custom_callable), "<MyCallableCustom>");
# PackedArray iterators
assert_equal(example.test_vector_ops(), 105)