Fixed dictionary (map) JSON test.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sun, 26 Oct 2014 23:09:07 +0000
changeset 228 4643ebc30c24
parent 227 0a78e48d766a
child 229 61c62a880046
Fixed dictionary (map) JSON test. Make it independent on key order (which depends on hashing algorithm)
s/tests/BenchmarkReportJSONWriterTests.st
--- a/s/tests/BenchmarkReportJSONWriterTests.st	Mon Oct 13 10:56:03 2014 +0100
+++ b/s/tests/BenchmarkReportJSONWriterTests.st	Sun Oct 26 23:09:07 2014 +0000
@@ -73,17 +73,19 @@
 !
 
 testMaps
-        | writer dictionary |
+        | writer dictionary json |
         dictionary := Dictionary new.
         dictionary at: #x put: 1.
         dictionary at: #y put: 2.
         writer := [ :object | 
                 String streamContents: [ :stream |
                         (BenchmarkReportJSONWriter on: stream) nextPut: object ] ].
-        self assert: (writer value: dictionary) equals: '{"x": 1,"y": 2}'.
-        self assert: (writer value: Dictionary new) equals: '{}'.
+        json := writer value: dictionary.
+        self assert:  (json = '{"x": 1,"y": 2}' or:[ json = '{"y": 2,"x": 1}' ]).
+        json := writer value: Dictionary new.
+        self assert: json = '{}'
 
-    "Modified: / 12-06-2013 / 13:23:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 26-10-2014 / 23:08:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 testNull