mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 14:51:15 +00:00
C++ interpreter: Use std::span instead of the internal Slice in the public API
This commit is contained in:
parent
d0b3adeba9
commit
973c5960b7
5 changed files with 37 additions and 32 deletions
|
@ -366,7 +366,7 @@ SCENARIO("Invoke callback")
|
|||
return Value(SharedString(res));
|
||||
}));
|
||||
Value args[] = { SharedString("Hello"), 42. };
|
||||
auto res = instance->invoke_callback("some_callback", Slice<Value> { args, 2 });
|
||||
auto res = instance->invoke_callback("some_callback", args);
|
||||
REQUIRE(res.has_value());
|
||||
REQUIRE(*res->to_string() == SharedString("Hello:42"));
|
||||
}
|
||||
|
@ -379,7 +379,7 @@ SCENARIO("Invoke callback")
|
|||
auto instance = result->create();
|
||||
REQUIRE(!instance->set_callback("bar", [](auto) { return Value(); }));
|
||||
Value args[] = { SharedString("Hello"), 42. };
|
||||
auto res = instance->invoke_callback("bar", Slice<Value> { args, 2 });
|
||||
auto res = instance->invoke_callback("bar", args);
|
||||
REQUIRE(!res.has_value());
|
||||
}
|
||||
}
|
||||
|
@ -573,8 +573,7 @@ SCENARIO("Global properties")
|
|||
REQUIRE(result->to_string().value() == "ABC");
|
||||
|
||||
Value args[] = { SharedString("Hello") };
|
||||
auto res = instance->invoke_global_callback("The_Global", "to-uppercase",
|
||||
Slice<Value> { args, 1 });
|
||||
auto res = instance->invoke_global_callback("The_Global", "to-uppercase", args);
|
||||
REQUIRE(res.has_value());
|
||||
REQUIRE(*res->to_string() == SharedString("HELLO"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue