summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsjamaan <>2012-02-28 16:40:41 +0000
committersjamaan <>2012-02-28 16:40:41 +0000
commitd6dc9a7425c3f86fd745ba8d2361fa32e4aaa6b4 (patch)
tree6c248f73143228cc59e6586a33be9ac1ca914932
parent7ed89088f39047fa35e40901258548ab7d536788 (diff)
downloadchicken-xml-rpc-d6dc9a7425c3f86fd745ba8d2361fa32e4aaa6b4.tar
chicken-xml-rpc-d6dc9a7425c3f86fd745ba8d2361fa32e4aaa6b4.tar.gz
chicken-xml-rpc-d6dc9a7425c3f86fd745ba8d2361fa32e4aaa6b4.tar.bz2
chicken-xml-rpc-d6dc9a7425c3f86fd745ba8d2361fa32e4aaa6b4.tar.lz
chicken-xml-rpc-d6dc9a7425c3f86fd745ba8d2361fa32e4aaa6b4.tar.xz
chicken-xml-rpc-d6dc9a7425c3f86fd745ba8d2361fa32e4aaa6b4.tar.zst
chicken-xml-rpc-d6dc9a7425c3f86fd745ba8d2361fa32e4aaa6b4.zip
xml-rpc: Fix test not to make assumptions about hash table ordering
-rw-r--r--tests/run.scm29
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