3 test_description
='test oidmap'
6 # This purposefully is very similar to t0011-hashmap.sh
9 echo "$1" | test-tool oidmap
$3 >actual
&&
11 test_cmp expect actual
15 test_expect_success
'setup' '
24 test_expect_success
'put' '
26 test_oidmap "put one 1
31 Unknown oid: invalidOid
36 test_expect_success
'replace' '
38 test_oidmap "put one 1
46 Unknown oid: invalidOid
52 test_expect_success
'get' '
54 test_oidmap "put one 1
65 Unknown oid: invalidOid
70 test_expect_success
'remove' '
72 test_oidmap "put one 1
83 Unknown oid: invalidOid
88 test_expect_success
'iterate' '
89 test-tool oidmap >actual.raw <<-\EOF &&
96 # sort "expect" too so we do not rely on the order of particular oids
97 sort >expect <<-EOF &&
101 $(git rev-parse one) 1
102 $(git rev-parse two) 2
103 $(git rev-parse three) 3
106 sort <actual.raw >actual &&
107 test_cmp expect actual