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