From 722b2c4334f51475adaa47c1de96c65e460c8e6d Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 17 Oct 2026 07:54:04 +0200 Subject: [PATCH] Skip the digit accumulation checks without exceptions The section compares error messages from both lexer paths and parses out-of-range numbers, so it does not compile (the caught exception does not exist) and would abort with JSON_NOEXCEPTION. Signed-off-by: Niels Lohmann --- tests/src/unit-class_lexer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/src/unit-class_lexer.cpp b/tests/src/unit-class_lexer.cpp index 91c835db3..ee96ca570 100644 --- a/tests/src/unit-class_lexer.cpp +++ b/tests/src/unit-class_lexer.cpp @@ -335,6 +335,8 @@ TEST_CASE("lexer number fast path") } } +#if !defined(JSON_NOEXCEPTION) + // this section reports parse errors, which abort when exceptions are off SECTION("digits accumulated while scanning") { // The fast path accumulates the digits while it validates them, eight @@ -413,6 +415,7 @@ TEST_CASE("lexer number fast path") } } } +#endif SECTION("integers that do not fit a narrower type become floats") {