Skip to content

Commit

Permalink
Extend std::vector<bool> unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
falbrechtskirchinger committed Aug 5, 2022
1 parent 5315f4f commit f5188df
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/src/unit-constructor1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,15 @@ TEST_CASE("constructors")
{
std::vector<bool> v{true};
json j(v[0]);
CHECK(std::is_same<decltype(v[0]), std::vector<bool>::reference>::value);
CHECK(j.type() == json::value_t::boolean);
}

SECTION("from std::vector<bool>::const_refrence")
{
const std::vector<bool> v{true};
json j(v[0]);
CHECK(std::is_same<decltype(v[0]), std::vector<bool>::const_reference>::value);
CHECK(j.type() == json::value_t::boolean);
}
}
Expand Down

0 comments on commit f5188df

Please sign in to comment.