mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 07:37:24 +00:00
C++ interpreter API: add a Value::Value(int)
constructor (#974)
This commit is contained in:
parent
ea2e91ece9
commit
350f0d0d6a
3 changed files with 12 additions and 0 deletions
|
@ -36,6 +36,11 @@ SCENARIO("Value API")
|
|||
auto number_opt = value.to_number();
|
||||
REQUIRE(number_opt.has_value());
|
||||
REQUIRE(number_opt.value() == number);
|
||||
|
||||
Value v2 = 42;
|
||||
REQUIRE(v2.type() == Value::Type::Number);
|
||||
REQUIRE(v2 == value);
|
||||
REQUIRE(*v2.to_number() == number);
|
||||
}
|
||||
|
||||
SECTION("Construct a bool")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue