]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t0016-oidmap.sh
t: sort output of hashmap iteration
[thirdparty/git.git] / t / t0016-oidmap.sh
index bbe719e9509689e38dd1d524d5d4b57de934a757..31f8276ba82bad3129c4a3cfa92f2d0ba798073c 100755 (executable)
@@ -86,17 +86,25 @@ NULL"
 '
 
 test_expect_success 'iterate' '
-
-test_oidmap "put one 1
-put two 2
-put three 3
-iterate" "NULL
-NULL
-NULL
-$(git rev-parse two) 2
-$(git rev-parse one) 1
-$(git rev-parse three) 3"
-
+       test-tool oidmap >actual.raw <<-\EOF &&
+       put one 1
+       put two 2
+       put three 3
+       iterate
+       EOF
+
+       # sort "expect" too so we do not rely on the order of particular oids
+       sort >expect <<-EOF &&
+       NULL
+       NULL
+       NULL
+       $(git rev-parse one) 1
+       $(git rev-parse two) 2
+       $(git rev-parse three) 3
+       EOF
+
+       sort <actual.raw >actual &&
+       test_cmp expect actual
 '
 
 test_done