From 937303160936e17e8ba326bdbd863cb18fef26fa Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 20 Aug 2026 02:00:30 +0200 Subject: [PATCH] Format the new string fast path test with astyle The pinned astyle expands a braced-init-list used as a range-for range onto several lines; hoist the two offsets into a named vector instead, which reads better and leaves nothing for astyle to reformat. Signed-off-by: Niels Lohmann --- tests/src/unit-class_lexer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/src/unit-class_lexer.cpp b/tests/src/unit-class_lexer.cpp index 21cd0e47e..a7b7bf927 100644 --- a/tests/src/unit-class_lexer.cpp +++ b/tests/src/unit-class_lexer.cpp @@ -456,6 +456,10 @@ TEST_CASE("lexer string fast path") } }; + // once at the start of the string, once past the first 8-byte SWAR word, so + // the bulk scanner sees each case with and without a run behind it + const std::vector offsets{0, 9}; + SECTION("exhaustive contiguous vs streaming parity") { // ordinary ASCII, both specials, a control byte, characters that make @@ -485,9 +489,7 @@ TEST_CASE("lexer string fast path") for (const auto& token : tokens) { - // once at the start of the string, once past the first 8-byte - // SWAR word so the bulk scanner has a run behind it - for (const std::size_t offset : {static_cast(0), static_cast(9)}) + for (const std::size_t offset : offsets) { const std::string doc = "[\"" + std::string(offset, 'a') + token + "\"]"; if (outcome(doc, false) != outcome(doc, true)) @@ -570,9 +572,7 @@ TEST_CASE("lexer string fast path") for (const auto& test_case : cases) { CAPTURE(test_case.description); - // at the start of the string and past the first SWAR word, so the - // sequence is seen by the bulk scanner and by its tail - for (const std::size_t offset : {static_cast(0), static_cast(9)}) + for (const std::size_t offset : offsets) { CAPTURE(offset); const std::string doc = "[\"" + std::string(offset, 'a') + test_case.sequence + "\"]";