Skip to content

Commit

Permalink
Add Hasher tests for objects where key eq value
Browse files Browse the repository at this point in the history
  • Loading branch information
aikawayataro authored and miloyip committed Sep 28, 2023
1 parent 6f79698 commit f9d5341
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/unittest/schematest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ TEST(SchemaValidator, Hasher) {
TEST_HASHER("{\"a\":1}", "{\"a\":1}", true);
TEST_HASHER("{\"a\":1}", "{\"b\":1}", false);
TEST_HASHER("{\"a\":1}", "{\"a\":2}", false);
TEST_HASHER("{\"a\":\"a\"}", "{\"b\":\"b\"}", false); // Key equals value hashing
TEST_HASHER("{\"a\":\"a\", \"b\":\"b\"}", "{\"c\":\"c\", \"d\":\"d\"}", false);
TEST_HASHER("{\"a\":\"a\"}", "{\"b\":\"b\", \"c\":\"c\"}", false);
TEST_HASHER("{\"a\":1, \"b\":2}", "{\"b\":2, \"a\":1}", true); // Member order insensitive
TEST_HASHER("{}", "null", false);
TEST_HASHER("{}", "false", false);
Expand Down

0 comments on commit f9d5341

Please sign in to comment.