diff options
xml-rpc: Fix test not to make assumptions about hash table ordering
-rw-r--r-- | tests/run.scm | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/tests/run.scm b/tests/run.scm index a24ce68..5fe04d4 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -71,17 +71,24 @@ (test "empty hash table" `(struct) (value->xml-rpc-fragment (alist->hash-table `()))) - (test "simple hash table" - ;; XXX: Hash ordering can change! Test is too specific - `(struct - (member - (name "qux") - (value (i4 "1"))) - (member - (name "foo") - (value (string "bar")))) - (value->xml-rpc-fragment - (alist->hash-table `((qux . 1) (foo . "bar"))))) + (test-assert + "simple hash table" + (let ((fragment (value->xml-rpc-fragment + (alist->hash-table `((qux . 1) (foo . "bar")))))) + (or (equal? fragment + `(struct (member + (name "qux") + (value (i4 "1"))) + (member + (name "foo") + (value (string "bar"))))) + (equal? fragment + `(struct (member + (name "foo") + (value (string "bar"))) + (member + (name "qux") + (value (i4 "1")))))))) (test "nested hash table" `(struct (member |