blob: 10417cdb94755d001a298aea8d37e1e3076a23b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#include "support/json.h"
#include "gtest/gtest.h"
using JSONTest = ::testing::Test;
TEST_F(JSONTest, Stringify) {
// TODO: change the API to not require a copy
auto input = "[\"hello\",\"world\"]";
auto* copy = strdup(input);
json::Value value;
value.parse(copy);
std::stringstream ss;
value.stringify(ss);
EXPECT_EQ(ss.str(), input);
free(copy);
}
|