mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Add SharedVector<T>::empty() and a constructor that takes an initializer list
This commit is contained in:
parent
ffb1d7bd83
commit
dc30106037
2 changed files with 29 additions and 0 deletions
|
@ -29,6 +29,21 @@ SCENARIO("SharedString API")
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Basic SharedVector API", "[vector]")
|
||||
{
|
||||
sixtyfps::SharedVector<int> vec;
|
||||
REQUIRE(vec.empty());
|
||||
|
||||
SECTION("Initializer list")
|
||||
{
|
||||
sixtyfps::SharedVector<int> vec({ 1, 4, 10 });
|
||||
REQUIRE(vec.size() == 3);
|
||||
REQUIRE(vec[0] == 1);
|
||||
REQUIRE(vec[1] == 4);
|
||||
REQUIRE(vec[2] == 10);
|
||||
}
|
||||
}
|
||||
|
||||
SCENARIO("Value API")
|
||||
{
|
||||
using namespace sixtyfps::interpreter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue