From d7a92a2976874cbb9584d943e88e8ccdfd810d53 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 17 Dec 2025 15:02:37 +0000 Subject: tests: Canonicalize JSON trees before comparing them. We must canonicalize JSON trees before comparing them since the order of keys in JSON objects is insignificant. --- tests/javascript.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/javascript.scm b/tests/javascript.scm index cf466b2..c670e98 100644 --- a/tests/javascript.scm +++ b/tests/javascript.scm @@ -20,6 +20,7 @@ (guix gexp) (ice-9 match) (ravanan work monads) + (ravanan work utils) (ravanan javascript)) (define (gexp->sexp-rec exp) @@ -46,12 +47,13 @@ '())) (test-equal "evaluate parameter reference to JSON object" - '(("class" . "File") - ("path" . "/foo/bar")) - (evaluate-javascript-expression "$(inputs.fasta)" - '(("inputs" ("fasta" - ("class" . "File") - ("path" . "/foo/bar")))))) + (canonicalize-json '(("class" . "File") + ("path" . "/foo/bar"))) + (canonicalize-json + (evaluate-javascript-expression "$(inputs.fasta)" + '(("inputs" ("fasta" + ("class" . "File") + ("path" . "/foo/bar"))))))) (test-equal "evaluate parameter reference with string interpolation" "24foo12foobar" -- cgit 1.4.1