Zwischenstand
This commit is contained in:
parent
a5188b08df
commit
16fa85e9f2
7 changed files with 6678 additions and 8255 deletions
14416
test/catch.hpp
14416
test/catch.hpp
File diff suppressed because it is too large
Load diff
|
@ -9,6 +9,11 @@
|
|||
|
||||
using nlohmann::json;
|
||||
|
||||
TEST_CASE()
|
||||
{
|
||||
CHECK(json::parser("[1,2,3,4,5,6]").parse().dump() == "[1,2,3,4,5,6]");
|
||||
}
|
||||
|
||||
TEST_CASE()
|
||||
{
|
||||
CHECK(json::escape_string("\\") == "\\\\");
|
||||
|
@ -18,12 +23,18 @@ TEST_CASE()
|
|||
CHECK(json::escape_string("\f") == "\\f");
|
||||
CHECK(json::escape_string("\b") == "\\b");
|
||||
CHECK(json::escape_string("\t") == "\\t");
|
||||
|
||||
|
||||
CHECK(json::escape_string("Lorem ipsum \"dolor\" sit amet,\nconsectetur \\ adipiscing elit.")
|
||||
== "Lorem ipsum \\\"dolor\\\" sit amet,\\nconsectetur \\\\ adipiscing elit.");
|
||||
CHECK(json::escape_string("the main said, \"cool!\"") == "the main said, \\\"cool!\\\"");
|
||||
CHECK(json::escape_string("\a") == "\\u0007");
|
||||
CHECK(json::escape_string("\v") == "\\u000b");
|
||||
|
||||
{
|
||||
json j = "AC/DC";
|
||||
CHECK(j.dump() == "\"AC/DC\"");
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
json j = {1, 2, 3, 4};
|
||||
std::cerr << j << std::endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue