• Home
  • Raw
  • Download

Lines Matching +full:x +full:- +full:access +full:- +full:token

6 // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
7 // SPDX-License-Identifier: MIT
15 using namespace nlohmann::literals; // NOLINT(google-build-using-namespace)
26 …or.107] parse error at byte 1: JSON pointer must be empty or begin with '/' - was: 'foo'", json::p…
45 … "[json.exception.out_of_range.404] unresolved reference token '10e'", json::out_of_range&);
51 SECTION("nonconst access")
74 // array access
85 CHECK(!j.contains(json::json_pointer("/foo/-")));
87 // checked array access
91 // empty string access
112 // checked access
120 // escaped access
126 // unescaped access
127 // access to nonexisting values yield object creation
138 CHECK(!j.contains(json::json_pointer("/a/d/-")));
139 CHECK_NOTHROW(j[json::json_pointer("/a/d/-")] = 42);
140 CHECK(!j.contains(json::json_pointer("/a/d/-")));
145 // unresolved access
148 … "[json.exception.out_of_range.404] unresolved reference token 'foo'", json::out_of_range&);
150 … "[json.exception.out_of_range.404] unresolved reference token 'foo'", json::out_of_range&);
154 SECTION("const access")
175 // array access
181 // checked array access
185 // empty string access
196 // checked access
204 // escaped access
208 // unescaped access
212 // unresolved access
215 … "[json.exception.out_of_range.404] unresolved reference token 'foo'", json::out_of_range&);
217 … "[json.exception.out_of_range.404] unresolved reference token 'foo'", json::out_of_range&);
220 SECTION("user-defined string literal")
241 // array access
248 CHECK(!j.contains("/foo/-"_json_pointer));
252 SECTION("array access")
254 SECTION("nonconst access")
259 // check reading access
308 … "[json.exception.out_of_range.404] unresolved reference token '1+1'", json::out_of_range&);
310 … "[json.exception.out_of_range.404] unresolved reference token '1+1'", json::out_of_range&);
315 …msg = std::string("[json.exception.out_of_range.404] unresolved reference token '") + too_large_in…
351 // assign to "-"
352 j["/-"_json_pointer] = 99;
355 // error when using "-" in const object
356 CHECK_THROWS_WITH_AS(j_const["/-"_json_pointer],
357 … "[json.exception.out_of_range.402] array index '-' (3) is out of range", json::out_of_range&);
358 CHECK(!j_const.contains("/-"_json_pointer));
360 // error when using "-" with at
361 CHECK_THROWS_WITH_AS(j.at("/-"_json_pointer),
362 … "[json.exception.out_of_range.402] array index '-' (7) is out of range", json::out_of_range&);
363 CHECK_THROWS_WITH_AS(j_const.at("/-"_json_pointer),
364 … "[json.exception.out_of_range.402] array index '-' (3) is out of range", json::out_of_range&);
365 CHECK(!j_const.contains("/-"_json_pointer));
368 SECTION("const access")
372 // check reading access
387 // assign to "-"
388 CHECK_THROWS_WITH_AS(j["/-"_json_pointer],
389 … "[json.exception.out_of_range.402] array index '-' (3) is out of range", json::out_of_range&);
390 CHECK_THROWS_WITH_AS(j.at("/-"_json_pointer),
391 … "[json.exception.out_of_range.402] array index '-' (3) is out of range", json::out_of_range&);
392 CHECK(!j.contains("/-"_json_pointer));
502 // all numbers -> array
510 // contains a number, but is not a number -> object
543 // empty json_pointer returns the root JSON-object
548 // simple field access
557 // object and children access
564 // check access via const pointer
583 // parent-pointer of the empty json_pointer is empty
619 // empty json_pointer returns the root JSON-object
623 // simple field access
630 // object and children access
643 // list children access
656 …tr_castring[] = "/foo/bar"; // NOLINT(hicpp-avoid-c-arrays,modernize-avoid-c-arrays,cppcoreguideli…
691 …or.107] parse error at byte 1: JSON pointer must be empty or begin with '/' - was: 'foo'", json::p…
693 …or.107] parse error at byte 1: JSON pointer must be empty or begin with '/' - was: 'foo'", json::p…
701 SECTION("less-than comparison")
760 CHECK(j.value(ptr, "x") == j.value(ptr_j, "x"));
761 CHECK(j.value(ptr, "x") == j.value(ptr_oj, "x"));