summaryrefslogtreecommitdiff
path: root/t/t0016-oidmap.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-08-01 09:10:50 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-08-01 09:10:50 -0700
commit49541dbb36b4a6f68dfe341850aa20dcebbe7641 (patch)
tree6a8f965ff0ed2c3b77e0fffea9d8e98f4e534c92 /t/t0016-oidmap.sh
parentMerge branch 'jc/dir-iterator-test-fix' (diff)
parentt: sort output of hashmap iteration (diff)
downloadtgif-49541dbb36b4a6f68dfe341850aa20dcebbe7641.tar.xz
Merge branch 'jk/sort-iter-test-output'
* jk/sort-iter-test-output: t: sort output of hashmap iteration
Diffstat (limited to 't/t0016-oidmap.sh')
-rwxr-xr-xt/t0016-oidmap.sh30
1 files changed, 19 insertions, 11 deletions
diff --git a/t/t0016-oidmap.sh b/t/t0016-oidmap.sh
index bbe719e950..31f8276ba8 100755
--- a/t/t0016-oidmap.sh
+++ b/t/t0016-oidmap.sh
@@ -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