From 315a1daada6d3981b4e4397b022322cc2b6d3135 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 10:55:25 +0000 Subject: [PATCH] Expect the byte range of the root in the json_view boolean get() test With JSON_DIAGNOSTIC_POSITIONS, the type_error.302 message starts with "(bytes 0-4)"; build the expected text with json_view_test::message(), as the other tests of the root value do. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01N5NasAgbDGG28MqXjQvLqp Signed-off-by: Claude --- tests/src/unit-json_view.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/src/unit-json_view.cpp b/tests/src/unit-json_view.cpp index 5f695e1f2..8dc60e912 100644 --- a/tests/src/unit-json_view.cpp +++ b/tests/src/unit-json_view.cpp @@ -1616,9 +1616,9 @@ TEST_CASE("json_view get() of a boolean (#5988)") SECTION("the exceptions of the exact number types") { const json_document d = json_document::parse("true"); - CHECK_THROWS_WITH_AS(d.root().get(), "[json.exception.type_error.302] type must be number, but is boolean", json::type_error&); - CHECK_THROWS_WITH_AS(d.root().get(), "[json.exception.type_error.302] type must be number, but is boolean", json::type_error&); - CHECK_THROWS_WITH_AS(d.root().get(), "[json.exception.type_error.302] type must be number, but is boolean", json::type_error&); + CHECK_THROWS_WITH_AS(d.root().get(), json_view_test::message("type_error.302", "", 0, 4, "type must be number, but is boolean").c_str(), json::type_error&); + CHECK_THROWS_WITH_AS(d.root().get(), json_view_test::message("type_error.302", "", 0, 4, "type must be number, but is boolean").c_str(), json::type_error&); + CHECK_THROWS_WITH_AS(d.root().get(), json_view_test::message("type_error.302", "", 0, 4, "type must be number, but is boolean").c_str(), json::type_error&); CHECK(d.root().get() == 1); // get_to() and value() go through get() json::number_float_t x = 0;