22 using namespace folly;
24 TEST(CompareJson, Simple) {
25 constexpr
StringPiece json1 = R
"({"a": 1, "b": 2})"; 26 constexpr StringPiece json2 = R"({"b": 2, "a": 1})"; 30 constexpr StringPiece json3 = R"({"b": 3, "a": 1})"; 34 TEST(CompareJson, Malformed) { 35 constexpr StringPiece json1 = R"({"a": 1, "b": 2})"; 40 TEST(CompareJsonWithTolerance, Simple) { 53 EXPECT_TRUE(compare(R
"([1, 2, 3])", R"([1.05, 2, 3.01])")); 54 EXPECT_FALSE(compare(R"([1, 2, 3])", R"([1.2, 2, 3.01])")); 63 EXPECT_TRUE(compare(R
"({"a": 1, "b": 2})", R"({"b": 2.01, "a": 1.05})")); 64 EXPECT_FALSE(compare(R"({"a": 1, "b": 2})", R"({"b": 2.01, "a": 1.2})")); 65 EXPECT_FALSE(compare(R"({"a": 1, "b": 2})", R"({"b": 2})")); 66 EXPECT_FALSE(compare(R"({"a": 1, "b": 2})", R"({"c": 2.01, "a": 1.05})")); 72 R"({"a": 1, "b": 2})", R"({"b": 2.01, "a": 1.05})", 0.1); #define EXPECT_THROW(statement, expected_exception)
bool compareJsonWithTolerance(StringPiece json1, StringPiece json2, double tolerance)
—— Concurrent Priority Queue Implementation ——
#define EXPECT_TRUE(condition)
#define FOLLY_EXPECT_JSON_EQ(json1, json2)
#define FOLLY_EXPECT_JSON_NEAR(json1, json2, tolerance)
#define EXPECT_FALSE(condition)
TEST(SequencedExecutor, CPUThreadPoolExecutor)
bool compareJson(StringPiece json1, StringPiece json2)