Skip to content

Commit

Permalink
Wrote a test for frame::frame(const series&)
Browse files Browse the repository at this point in the history
  • Loading branch information
tedmiddleton committed Apr 30, 2023
1 parent 9032cfc commit 3854e84
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions tests/mainframe_test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ TEST_CASE("ctor"
REQUIRE(f1.size() == 0);
}

TEST_CASE("ctor( const& )"
"[frame]")
TEST_CASE("ctor( const& )", "[frame]")
{
frame<year_month_day, double, bool> f1;
REQUIRE(f1.size() == 0);
Expand All @@ -161,8 +160,7 @@ TEST_CASE("ctor( const& )"
REQUIRE(f2.size() == 4);
}

TEST_CASE("ctor( && )"
"[frame]")
TEST_CASE("ctor( && )", "[frame]")
{
frame<year_month_day, double, bool> f1;
REQUIRE(f1.size() == 0);
Expand All @@ -176,6 +174,24 @@ TEST_CASE("ctor( && )"
REQUIRE(f2.size() == 4);
}

TEST_CASE("ctor( series )", "[frame]")
{
series<year_month_day> s1;
REQUIRE(s1.size() == 0);
s1.push_back(2022_y / January / 2);
s1.push_back(2022_y / January / 3);
s1.push_back(2022_y / January / 4);
s1.push_back(2022_y / January / 5);
REQUIRE(s1.size() == 4);
frame<year_month_day> f1(s1);
REQUIRE(s1.size() == 4);
REQUIRE(f1.size() == 4);
REQUIRE((f1.begin() + 0)->at(_0) == 2022_y / January / 2);
REQUIRE((f1.begin() + 1)->at(_0) == 2022_y / January / 3);
REQUIRE((f1.begin() + 2)->at(_0) == 2022_y / January / 4);
REQUIRE((f1.begin() + 3)->at(_0) == 2022_y / January / 5);
}

TEST_CASE("begin()/end()", "[frame]")
{
frame<year_month_day, double, bool> f1;
Expand Down

0 comments on commit 3854e84

Please sign in to comment.