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 <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-11-01 07:17:13 +01:00
1 parent 14913168dd
commit 15597deac6
1 file changed
+4 -4
+4 -4
View File
@@ -3007,20 +3007,20 @@ TEST_CASE("accept() agrees with parse() on strings, which it checks without copy
closed += '"';
std::vector<std::string> 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)
{