20 #include <ripple/json/json_writer.h>
21 #include <ripple/json/Writer.h>
22 #include <test/json/TestOutputSuite.h>
23 #include <ripple/beast/unit_test.h>
39 setup (
"near trivial");
78 setup (
"empty array");
83 setup (
"empty object");
99 setup (
"backslash and quote");
103 setup (
"escape embedded");
105 expectResult (
"\"this contains a \\\\ in the middle of it.\"");
107 setup (
"remaining escapes");
114 setup (
"empty array");
123 setup (
"long array");
134 setup (
"embedded array simple");
154 setup (
"complex object");
169 expectResult (
"{\"hello\":\"world\",\"array\":[true,12,"
170 "[{\"goodbye\":\"cruel world.\","
171 "\"subarray\":[23.5]}]]}");
void setup(std::string const &testName)
void append(Scalar t)
Append a value to an array.
void finish()
Finish the collection most recently started.
BEAST_DEFINE_TESTSUITE(JsonObject, ripple_basics, ripple)
void set(std::string const &tag, Type t)
Add a key, value assignment to an object.
void startAppend(CollectionType)
Start a new collection inside an array.
void startRoot(CollectionType)
Start a new collection at the root level.
void finishAll()
Finish all objects and arrays.
JSON (JavaScript Object Notation).
@ objectValue
object value (collection of name/value pairs).
void testEmbeddedArraySimple()
std::unique_ptr< Json::Writer > writer_
void startSet(CollectionType, std::string const &key)
Start a new collection inside an object.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void expectResult(std::string const &expected, std::string const &message="")
void output(std::string const &)