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 6, 2022
1 parent 0779840 commit 3dac72e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/src/unit-constructor1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,19 @@ TEST_CASE("constructors")
CHECK(j.type() == json::value_t::boolean);
}

SECTION("from std::vector<bool>::refrence")
SECTION("from std::vector<bool>::reference")
{
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_reference")
{
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 3dac72e

Please sign in to comment.