Format the comparison examples with the pinned astyle
The "check" job runs astyle over the documentation examples once it gets past the amalgamation step. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+4
-4
No files matched your search
@@ -10,9 +10,9 @@ int main()
|
|||||||
// directly as views, without ever building a nlohmann::json value for
|
// directly as views, without ever building a nlohmann::json value for
|
||||||
// either one
|
// either one
|
||||||
const json_document previous = json_document::parse(
|
const json_document previous = json_document::parse(
|
||||||
R"({"name": "cache", "port": 6379, "timeout": 30})");
|
R"({"name": "cache", "port": 6379, "timeout": 30})");
|
||||||
const json_document current = json_document::parse(
|
const json_document current = json_document::parse(
|
||||||
R"({"port": 6379.0, "timeout": 30, "name": "cache"})");
|
R"({"port": 6379.0, "timeout": 30, "name": "cache"})");
|
||||||
|
|
||||||
// same members, reordered, and 6379 written as a float -- operator==
|
// same members, reordered, and 6379 written as a float -- operator==
|
||||||
// treats them the same way BasicJsonType::operator== would
|
// treats them the same way BasicJsonType::operator== would
|
||||||
@@ -20,7 +20,7 @@ int main()
|
|||||||
|
|
||||||
// an actually changed value is detected the same way
|
// an actually changed value is detected the same way
|
||||||
const json_document changed = json_document::parse(
|
const json_document changed = json_document::parse(
|
||||||
R"({"name": "cache", "port": 6380, "timeout": 30})");
|
R"({"name": "cache", "port": 6380, "timeout": 30})");
|
||||||
std::cout << (previous.root() == changed.root()) << '\n';
|
std::cout << (previous.root() == changed.root()) << '\n';
|
||||||
|
|
||||||
// comparing a view directly against an expected json value -- handy in a
|
// comparing a view directly against an expected json value -- handy in a
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ int main()
|
|||||||
// unwanted shape -- without ever materializing it into a json value just
|
// unwanted shape -- without ever materializing it into a json value just
|
||||||
// to compare
|
// to compare
|
||||||
const json_document received = json_document::parse(
|
const json_document received = json_document::parse(
|
||||||
R"({"status": "ok", "code": 200})");
|
R"({"status": "ok", "code": 200})");
|
||||||
const json unwanted = {{"status", "error"}, {"code", 500}};
|
const json unwanted = {{"status", "error"}, {"code", 500}};
|
||||||
std::cout << std::boolalpha << (received.root() != unwanted) << '\n';
|
std::cout << std::boolalpha << (received.root() != unwanted) << '\n';
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user