-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Milestone
Description
Looks like the following would do it. I'll test and submit a PR when I can.
declare variable $ARRAY-QNAME := fn:QName("http://marklogic.com/xdmp/json", "array");
declare function helper:assert-same-values($expected as item()*, $actual as item()*)
{
if (xdmp:type(fn:head($expected)) eq $ARRAY-QNAME) then
local:assert-same-values(json:array-values($expected), json:array-values($actual))
else
let $expected-ordered :=
for $e in $expected
order by $e
return $e
let $actual-ordered :=
for $a in $actual
order by $a
return $a
return helper:assert-equal($expected-ordered, $actual-ordered)
};
Metadata
Metadata
Assignees
Labels
No labels