1#include <xrpl/json/Output.h>
3#include <xrpl/json/json_reader.h>
4#include <xrpl/json/json_writer.h>
6#include <gtest/gtest.h>
23 EXPECT_EQ(output, expected);
24 EXPECT_EQ(output, valueDesc);
28TEST(JsonOutput, output_cases)
32 checkOutput(R
"([23,4.25,true,null,"string"])");
33 checkOutput(R"({"hello":"world"})");
36 checkOutput(R
"({"array":[{"12":23},{},null,false,0.5]})");
Outputs a Value in JSON format without formatting (not human friendly).
std::string write(Value const &root) override
Unserialize a JSON document into a Value.
JSON (JavaScript Object Notation).
void outputJson(json::Value const &, Output const &)
Writes a minimal representation of a Json value to an Output in O(n) time.
std::string jsonAsString(json::Value const &)
Return the minimal string representation of a json::Value in O(n) time.
Output stringOutput(std::string &s)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.