From 3857e55290fa735a5910b678be2f7186d3ff97c9 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 24 Jan 2017 12:43:43 +0100 Subject: [PATCH] :lipstick: ran "make pretty" --- test/src/unit-udt.cpp | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/test/src/unit-udt.cpp b/test/src/unit-udt.cpp index 07f85b37..4231e687 100644 --- a/test/src/unit-udt.cpp +++ b/test/src/unit-udt.cpp @@ -263,52 +263,52 @@ TEST_CASE("basic usage", "[udt]") u8R"({"name":"C++", "contacts" : [{"person" : {"age":23, "name":"theo", "country":"France"}, "address":"Paris"}, {"person" : {"age":42, "country":"中华人民共和国", "name":"王芳"}, "address":"Paris"}]})"_json; SECTION("via explicit calls to get") { - const auto parsed_book = big_json.get(); - const auto book_name = big_json["name"].get(); - const auto contacts = - big_json["contacts"].get>(); - const auto contact_json = big_json["contacts"].at(0); - const auto contact = contact_json.get(); - const auto person = contact_json["person"].get(); - const auto address = contact_json["address"].get(); - const auto age = contact_json["person"]["age"].get(); - const auto country = - contact_json["person"]["country"].get(); - const auto name = contact_json["person"]["name"].get(); + const auto parsed_book = big_json.get(); + const auto book_name = big_json["name"].get(); + const auto contacts = + big_json["contacts"].get>(); + const auto contact_json = big_json["contacts"].at(0); + const auto contact = contact_json.get(); + const auto person = contact_json["person"].get(); + const auto address = contact_json["address"].get(); + const auto age = contact_json["person"]["age"].get(); + const auto country = + contact_json["person"]["country"].get(); + const auto name = contact_json["person"]["name"].get(); - CHECK(age == a); - CHECK(name == n); - CHECK(country == c); - CHECK(address == addr); - CHECK(person == sfinae_addict); - CHECK(contact == cpp_programmer); - CHECK(contacts == book.m_contacts); - CHECK(book_name == udt::name{"C++"}); - CHECK(book == parsed_book); + CHECK(age == a); + CHECK(name == n); + CHECK(country == c); + CHECK(address == addr); + CHECK(person == sfinae_addict); + CHECK(contact == cpp_programmer); + CHECK(contacts == book.m_contacts); + CHECK(book_name == udt::name{"C++"}); + CHECK(book == parsed_book); } SECTION("implicit conversions") { - const udt::contact_book parsed_book = big_json; - const udt::name book_name = big_json["name"]; - const std::vector contacts = big_json["contacts"]; - const auto contact_json = big_json["contacts"].at(0); - const udt::contact contact = contact_json; - const udt::person person = contact_json["person"]; - const udt::address address = contact_json["address"]; - const udt::age age = contact_json["person"]["age"]; - const udt::country country = contact_json["person"]["country"]; - const udt::name name = contact_json["person"]["name"]; + const udt::contact_book parsed_book = big_json; + const udt::name book_name = big_json["name"]; + const std::vector contacts = big_json["contacts"]; + const auto contact_json = big_json["contacts"].at(0); + const udt::contact contact = contact_json; + const udt::person person = contact_json["person"]; + const udt::address address = contact_json["address"]; + const udt::age age = contact_json["person"]["age"]; + const udt::country country = contact_json["person"]["country"]; + const udt::name name = contact_json["person"]["name"]; - CHECK(age == a); - CHECK(name == n); - CHECK(country == c); - CHECK(address == addr); - CHECK(person == sfinae_addict); - CHECK(contact == cpp_programmer); - CHECK(contacts == book.m_contacts); - CHECK(book_name == udt::name{"C++"}); - CHECK(book == parsed_book); + CHECK(age == a); + CHECK(name == n); + CHECK(country == c); + CHECK(address == addr); + CHECK(person == sfinae_addict); + CHECK(contact == cpp_programmer); + CHECK(contacts == book.m_contacts); + CHECK(book_name == udt::name{"C++"}); + CHECK(book == parsed_book); } } }