mirror of
https://github.com/nlohmann/json.git
synced 2026-11-01 10:25:43 +00:00
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:
1 file changed
+4
-4
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user