3 test_description
='test oidmap'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 # This purposefully is very similar to t0011-hashmap.sh
11 echo "$1" | test-tool oidmap
$3 >actual
&&
13 test_cmp expect actual
17 test_expect_success
'setup' '
26 test_expect_success
'put' '
28 test_oidmap "put one 1
33 Unknown oid: invalidOid
38 test_expect_success
'replace' '
40 test_oidmap "put one 1
48 Unknown oid: invalidOid
54 test_expect_success
'get' '
56 test_oidmap "put one 1
67 Unknown oid: invalidOid
72 test_expect_success
'remove' '
74 test_oidmap "put one 1
85 Unknown oid: invalidOid
90 test_expect_success
'iterate' '
91 test-tool oidmap >actual.raw <<-\EOF &&
98 # sort "expect" too so we do not rely on the order of particular oids
99 sort >expect <<-EOF &&
103 $(git rev-parse one) 1
104 $(git rev-parse two) 2
105 $(git rev-parse three) 3
108 sort <actual.raw >actual &&
109 test_cmp expect actual