aboutsummaryrefslogtreecommitdiffstats
path: root/tests/json/t-json.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/json/t-json.c')
-rw-r--r--tests/json/t-json.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/json/t-json.c b/tests/json/t-json.c
index 1f45febd..7a4d9065 100644
--- a/tests/json/t-json.c
+++ b/tests/json/t-json.c
@@ -154,7 +154,19 @@ test_contains (cjson_t needle, cjson_t hay)
}
if (test_contains (needle->child, hay->child))
{
- return 1;
+ int found = 0;
+ for (cjson_t hit = hay->child; hit; hit = hit->next)
+ {
+ found |= !test_contains (needle->child, hit);
+ if (found)
+ {
+ break;
+ }
+ }
+ if (!found)
+ {
+ return 1;
+ }
}
}