summary refs log tree commit diff stats
path: root/tests/collections/tcollections.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/collections/tcollections.nim')
-rw-r--r--tests/collections/tcollections.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/collections/tcollections.nim b/tests/collections/tcollections.nim
index 5c95cee28..1e2858fb4 100644
--- a/tests/collections/tcollections.nim
+++ b/tests/collections/tcollections.nim
@@ -76,8 +76,12 @@ doAssert $(toOrderedSet(["1", "2", "3"])) == """{"1", "2", "3"}"""
 doAssert $(toOrderedSet(['1', '2', '3'])) == """{'1', '2', '3'}"""
 
 # Tests for tables
-doAssert $({1: "1", 2: "2"}.toTable) == """{1: "1", 2: "2"}"""
-doAssert $({"1": 1, "2": 2}.toTable) == """{"1": 1, "2": 2}"""
+when defined(nimIntHash1):
+  doAssert $({1: "1", 2: "2"}.toTable) == """{1: "1", 2: "2"}"""
+else:
+  doAssert $({1: "1", 2: "2"}.toTable) == """{2: "2", 1: "1"}"""
+let tabStr = $({"1": 1, "2": 2}.toTable)
+doAssert (tabStr == """{"2": 2, "1": 1}""" or tabStr == """{"1": 1, "2": 2}""")
 
 # Tests for deques
 block: