MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / JSONPrettyPrint

Function JSONPrettyPrint

src/test/script_tests.cpp:415–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413};
414
415std::string JSONPrettyPrint(const UniValue& univalue)
416{
417 std::string ret = univalue.write(4);
418 // Workaround for libunivalue pretty printer, which puts a space between commas and newlines
419 size_t pos = 0;
420 while ((pos = ret.find(" \n", pos)) != std::string::npos) {
421 ret.replace(pos, 2, "\n");
422 pos++;
423 }
424 return ret;
425}
426} // namespace
427
428BOOST_FIXTURE_TEST_SUITE(script_tests, ScriptTest)

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

findMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected