added more test cases

This commit is contained in:
Niels 2015-05-03 18:27:43 +02:00
parent 84561d8866
commit ab1ff9de53

View file

@ -1461,7 +1461,7 @@ TEST_CASE("object inspection")
CHECK(json("Ö").dump() == "\"Ö\""); CHECK(json("Ö").dump() == "\"Ö\"");
CHECK(json("❤️").dump() == "\"❤️\""); CHECK(json("❤️").dump() == "\"❤️\"");
} }
SECTION("serialization of discarded element") SECTION("serialization of discarded element")
{ {
json j_discarded(json::value_t::discarded); json j_discarded(json::value_t::discarded);
@ -6233,6 +6233,13 @@ TEST_CASE("lexicographical comparison operators")
CHECK( (j_values[i] == j_values[j]) == expected[i][j] ); CHECK( (j_values[i] == j_values[j]) == expected[i][j] );
} }
} }
// comparison with discarded elements
json j_discarded(json::value_t::discarded);
for (size_t i = 0; i < j_values.size(); ++i)
{
CHECK( (j_values[i] == j_discarded) == false);
}
} }
SECTION("comparison: not equal") SECTION("comparison: not equal")
@ -6275,6 +6282,13 @@ TEST_CASE("lexicographical comparison operators")
CHECK( (j_values[i] < j_values[j]) == expected[i][j] ); CHECK( (j_values[i] < j_values[j]) == expected[i][j] );
} }
} }
// comparison with discarded elements
json j_discarded(json::value_t::discarded);
for (size_t i = 0; i < j_values.size(); ++i)
{
CHECK( (j_values[i] < j_discarded) == false);
}
} }
SECTION("comparison: less than or equal equal") SECTION("comparison: less than or equal equal")