mirror of
https://github.com/nlohmann/json.git
synced 2026-02-22 11:26:25 +00:00
Replace "key-style argument" with "string argument"
This commit is contained in:
@@ -475,9 +475,9 @@ TEST_CASE("element access 2")
|
||||
CHECK_NOTHROW(j_nonobject2[json::object_t::key_type("foo")]);
|
||||
CHECK_THROWS_AS(j_const_nonobject["foo"], json::type_error&);
|
||||
CHECK_THROWS_AS(j_const_nonobject[json::object_t::key_type("foo")], json::type_error&);
|
||||
CHECK_THROWS_WITH(j_const_nonobject["foo"], "[json.exception.type_error.305] cannot use operator[] with a key-style argument with null");
|
||||
CHECK_THROWS_WITH(j_const_nonobject["foo"], "[json.exception.type_error.305] cannot use operator[] with a string argument with null");
|
||||
CHECK_THROWS_WITH(j_const_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with null");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with null");
|
||||
}
|
||||
|
||||
SECTION("boolean")
|
||||
@@ -489,13 +489,13 @@ TEST_CASE("element access 2")
|
||||
CHECK_THROWS_AS(j_const_nonobject["foo"], json::type_error&);
|
||||
CHECK_THROWS_AS(j_const_nonobject[json::object_t::key_type("foo")], json::type_error&);
|
||||
CHECK_THROWS_WITH(j_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with boolean");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with boolean");
|
||||
CHECK_THROWS_WITH(j_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with boolean");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with boolean");
|
||||
CHECK_THROWS_WITH(j_const_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with boolean");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with boolean");
|
||||
CHECK_THROWS_WITH(j_const_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with boolean");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with boolean");
|
||||
}
|
||||
|
||||
SECTION("string")
|
||||
@@ -507,13 +507,13 @@ TEST_CASE("element access 2")
|
||||
CHECK_THROWS_AS(j_const_nonobject["foo"], json::type_error&);
|
||||
CHECK_THROWS_AS(j_const_nonobject[json::object_t::key_type("foo")], json::type_error&);
|
||||
CHECK_THROWS_WITH(j_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with string");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with string");
|
||||
CHECK_THROWS_WITH(j_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with string");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with string");
|
||||
CHECK_THROWS_WITH(j_const_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with string");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with string");
|
||||
CHECK_THROWS_WITH(j_const_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with string");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with string");
|
||||
}
|
||||
|
||||
SECTION("array")
|
||||
@@ -525,12 +525,12 @@ TEST_CASE("element access 2")
|
||||
CHECK_THROWS_AS(j_const_nonobject["foo"], json::type_error&);
|
||||
CHECK_THROWS_AS(j_const_nonobject[json::object_t::key_type("foo")], json::type_error&);
|
||||
CHECK_THROWS_WITH(j_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with array");
|
||||
CHECK_THROWS_WITH(j_nonobject[json::object_t::key_type("foo")], "[json.exception.type_error.305] cannot use operator[] with a key-style argument with array");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with array");
|
||||
CHECK_THROWS_WITH(j_nonobject[json::object_t::key_type("foo")], "[json.exception.type_error.305] cannot use operator[] with a string argument with array");
|
||||
CHECK_THROWS_WITH(j_const_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with array");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with array");
|
||||
CHECK_THROWS_WITH(j_const_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with array");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with array");
|
||||
}
|
||||
|
||||
SECTION("number (integer)")
|
||||
@@ -542,13 +542,13 @@ TEST_CASE("element access 2")
|
||||
CHECK_THROWS_AS(j_const_nonobject["foo"], json::type_error&);
|
||||
CHECK_THROWS_AS(j_const_nonobject[json::object_t::key_type("foo")], json::type_error&);
|
||||
CHECK_THROWS_WITH(j_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
CHECK_THROWS_WITH(j_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
CHECK_THROWS_WITH(j_const_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
CHECK_THROWS_WITH(j_const_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
}
|
||||
|
||||
SECTION("number (unsigned)")
|
||||
@@ -560,13 +560,13 @@ TEST_CASE("element access 2")
|
||||
CHECK_THROWS_AS(j_const_nonobject["foo"], json::type_error&);
|
||||
CHECK_THROWS_AS(j_const_nonobject[json::object_t::key_type("foo")], json::type_error&);
|
||||
CHECK_THROWS_WITH(j_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
CHECK_THROWS_WITH(j_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
CHECK_THROWS_WITH(j_const_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
CHECK_THROWS_WITH(j_const_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
}
|
||||
|
||||
SECTION("number (floating-point)")
|
||||
@@ -578,13 +578,13 @@ TEST_CASE("element access 2")
|
||||
CHECK_THROWS_AS(j_const_nonobject["foo"], json::type_error&);
|
||||
CHECK_THROWS_AS(j_const_nonobject[json::object_t::key_type("foo")], json::type_error&);
|
||||
CHECK_THROWS_WITH(j_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
CHECK_THROWS_WITH(j_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
CHECK_THROWS_WITH(j_const_nonobject["foo"],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
CHECK_THROWS_WITH(j_const_nonobject[json::object_t::key_type("foo")],
|
||||
"[json.exception.type_error.305] cannot use operator[] with a key-style argument with number");
|
||||
"[json.exception.type_error.305] cannot use operator[] with a string argument with number");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user