Add the boilerplate for Struct in C++

This commit is contained in:
Simon Hausmann 2021-03-18 12:12:48 +01:00
parent 533b7f05ce
commit 02c1150fa7
3 changed files with 118 additions and 11 deletions

View file

@ -113,4 +113,15 @@ SCENARIO("Value API")
REQUIRE(brush_opt.has_value());
REQUIRE(brush_opt.value() == brush);
}
SECTION("Construct a struct")
{
REQUIRE(!value.to_struct().has_value());
sixtyfps::interpreter::Struct struc;
value = Value(struc);
REQUIRE(value.type() == Value::Type::Struct);
auto struct_opt = value.to_struct();
REQUIRE(struct_opt.has_value());
}
}