+ more test cases

This commit is contained in:
Niels 2014-12-28 22:07:10 +01:00
parent 48a349a058
commit aacb58e56b

View file

@ -1099,6 +1099,21 @@ TEST_CASE("Iterators")
const JSON j7_const = "hello"; const JSON j7_const = "hello";
// operator * // operator *
CHECK(* j1.begin() == JSON(0));
CHECK(* j1_const.begin() == JSON(0));
CHECK(* j2.begin() != JSON());
CHECK(* j2_const.begin() != JSON());
CHECK(* j3.begin() == JSON(true));
CHECK(* j3_const.begin() == JSON(true));
CHECK(* j4.begin() == JSON());
CHECK(* j4_const.begin() == JSON());
CHECK(* j5.begin() == JSON(42));
CHECK(* j5_const.begin() == JSON(42));
CHECK(* j6.begin() == JSON(23.42));
CHECK(* j6_const.begin() == JSON(23.42));
CHECK(* j7.begin() == JSON("hello"));
CHECK(* j7_const.begin() == JSON("hello"));
CHECK_THROWS_AS(* j1.end(), std::runtime_error); CHECK_THROWS_AS(* j1.end(), std::runtime_error);
CHECK_THROWS_AS(* j1.cend(), std::runtime_error); CHECK_THROWS_AS(* j1.cend(), std::runtime_error);
CHECK_THROWS_AS(* j2.end(), std::runtime_error); CHECK_THROWS_AS(* j2.end(), std::runtime_error);