Skip to content

Commit

Permalink
Fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed May 16, 2024
1 parent 0768907 commit ce0a6f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/tests/test_jsonrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ UTEST(jsonrpc, test_json_get_object_string) {
list_init(&l);
//valid
sds data = sdsnew("{\"key1\": {\"k1\": \"string1\", \"k2\": \"string2\"}}");
ASSERT_TRUE(json_get_object_string(data, "$.key1", &l, vcb_isname, 10, NULL));
ASSERT_TRUE(json_get_object_string(data, "$.key1", &l, vcb_isname, vcb_isname,10, NULL));
list_clear(&l);
//invalid - validation error
ASSERT_FALSE(json_get_object_string(data, "$.key1", &l, vcb_ishexcolor, 10, NULL));
ASSERT_FALSE(json_get_object_string(data, "$.key1", &l, vcb_isalnum, vcb_ishexcolor, 10, NULL));
list_clear(&l);
//invalid - too many array elements
ASSERT_TRUE(json_get_object_string(data, "$.key1", &l, vcb_isname, 1, NULL));
ASSERT_TRUE(json_get_object_string(data, "$.key1", &l, vcb_isname, vcb_isname,1, NULL));
ASSERT_EQ(1U, l.length);
FREE_SDS(data);
list_clear(&l);
Expand Down

0 comments on commit ce0a6f4

Please sign in to comment.