MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / TEST

Function TEST

source/test/formatted_json_test.cpp:8–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace Star;
7
8TEST(FormattedJsonTest, JsonInterop) {
9 Json array1 = JsonArray{1, 2, 3, 4};
10 Json array2 = JsonArray{4, 3, 2, 1};
11 FormattedJson farray1 = array1;
12 FormattedJson farray2 = array2;
13
14 EXPECT_EQ(farray1.toJson(), array1);
15 EXPECT_EQ(farray2.toJson(), array2);
16 EXPECT_NE(farray1.toJson(), array2);
17 EXPECT_NE(farray2.toJson(), array1);
18}
19
20TEST(FormattedJsonTest, Parsing) {
21 FormattedJson json1 = FormattedJson::parse(R"JSON(

Callers

nothing calls this directly

Calls 15

keyOrderFunction · 0.85
PointerClass · 0.85
QueryPathClass · 0.85
insertAtMethod · 0.80
insertBeforeMethod · 0.80
parseFunction · 0.50
toJsonMethod · 0.45
getMethod · 0.45
isTypeMethod · 0.45
setMethod · 0.45
appendMethod · 0.45
prependMethod · 0.45

Tested by

no test coverage detected