kwid_compare_lists()
#
Compare two JSON lists of records, allowing for unordered comparison. The function checks if both lists contain the same elements, considering optional metadata and private key exclusions.
Prototype
BOOL kwid_compare_lists(
hgobj gobj,
json_t *list, // NOT owned
json_t *expected, // NOT owned
BOOL without_metadata,
BOOL without_private,
BOOL verbose
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
Pointer to the GObj context for logging and error handling. |
|
|
The first JSON list to compare. Not owned by the function. |
|
|
The second JSON list to compare against. Not owned by the function. |
|
|
If TRUE, metadata keys (keys starting with ‘__’) are ignored during comparison. |
|
|
If TRUE, private keys (keys starting with ‘_’) are ignored during comparison. |
|
|
If TRUE, detailed error messages are logged when mismatches occur. |
Return Value
Returns TRUE if both lists contain the same elements, considering the specified exclusions. Returns FALSE if they differ.
Notes
This function performs a deep comparison of JSON lists, allowing for unordered elements. It internally calls kwid_compare_records()
for record-level comparison.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples