MCPcopy Create free account
hub / github.com/NPP-JSONViewer/JSON-Viewer / TEST_F

Function TEST_F

tests/UnitTest/JsonCompressTest.cpp:26–37  ·  view source on GitHub ↗

Test 1: Test valid JSON with default formatting options

Source from the content-addressed store, hash-verified

24
25 // Test 1: Test valid JSON with default formatting options
26 TEST_F(JsonCompressTest, CompressJson_ValidJson)
27 {
28 const std::string inputJson = R"({"name": "John", "age": 30})";
29
30 auto result = m_jsonHandler.GetCompressedJson(inputJson);
31
32 EXPECT_TRUE(result.success);
33 EXPECT_EQ(result.error_code, -1);
34 EXPECT_EQ(result.error_pos, -1);
35 EXPECT_EQ(result.error_str, "");
36 EXPECT_EQ(result.response, R"({"name":"John","age":30})");
37 }
38
39 // Test 2: Test invalid JSON input
40 TEST_F(JsonCompressTest, CompressJson_InvalidJson)

Callers

nothing calls this directly

Calls 1

GetCompressedJsonMethod · 0.80

Tested by

no test coverage detected