From 15597deac6b10ba0dd42a54be5f0e8482032398a Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 1 Nov 2026 07:17:13 +0100 Subject: [PATCH] accept() tests: emplace the string literals that start each text ci_clang_tidy reports modernize-use-emplace for texts.push_back("[") and the other literals in the accept() string test. Signed-off-by: Niels Lohmann --- tests/src/unit-class_parser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/src/unit-class_parser.cpp b/tests/src/unit-class_parser.cpp index c846e4db4..987e25858 100644 --- a/tests/src/unit-class_parser.cpp +++ b/tests/src/unit-class_parser.cpp @@ -3007,20 +3007,20 @@ TEST_CASE("accept() agrees with parse() on strings, which it checks without copy closed += '"'; std::vector texts; texts.push_back(closed); - texts.push_back("["); + texts.emplace_back("["); texts.back() += closed; texts.back() += ']'; - texts.push_back("{"); + texts.emplace_back("{"); texts.back() += closed; texts.back() += ":1}"; - texts.push_back("{\"k\":"); + texts.emplace_back("{\"k\":"); texts.back() += closed; texts.back() += ','; texts.back() += closed; texts.back() += ":["; texts.back() += closed; texts.back() += "]}"; - texts.push_back("["); + texts.emplace_back("["); texts.back() += opened; for (const std::string& text : texts) {