20#include <test/json/TestOutputSuite.h>
22#include <xrpl/beast/unit_test.h>
23#include <xrpl/json/Writer.h>
41 setup(
"near trivial");
87 setup(
"empty object");
104 setup(
"backslash and quote");
108 setup(
"escape embedded");
110 expectResult(
"\"this contains a \\\\ in the middle of it.\"");
112 setup(
"remaining escapes");
120 setup(
"empty array");
142 setup(
"embedded array simple");
164 setup(
"complex object");
180 "{\"hello\":\"world\",\"array\":[true,12,"
181 "[{\"goodbye\":\"cruel world.\","
182 "\"subarray\":[23.5]}]]}");
215BEAST_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.