3 test_description
='basic tests for the oid array implementation'
5 TEST_PASSES_SANITIZE_LEAK
=true
13 echo "$prefix$ZERO_OID" |
sed -e "s/00/$1/g"
18 test_expect_success
'without repository' '
20 4444444444444444444444444444444444444444
21 5555555555555555555555555555555555555555
22 8888888888888888888888888888888888888888
23 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
26 append 4444444444444444444444444444444444444444
27 append 5555555555555555555555555555555555555555
28 append 8888888888888888888888888888888888888888
29 append aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
32 nongit test-tool oid-array <input >actual &&
33 test_cmp expect actual
36 test_expect_success
'ordered enumeration' '
37 echoid "" 44 55 88 aa >expect &&
39 echoid append 88 44 aa 55 &&
41 } | test-tool oid-array >actual &&
42 test_cmp expect actual
45 test_expect_success
'ordered enumeration with duplicate suppression' '
46 echoid "" 44 55 88 aa >expect &&
48 echoid append 88 44 aa 55 &&
49 echoid append 88 44 aa 55 &&
50 echoid append 88 44 aa 55 &&
52 } | test-tool oid-array >actual &&
53 test_cmp expect actual
56 test_expect_success
'lookup' '
58 echoid append 88 44 aa 55 &&
60 } | test-tool oid-array >actual &&
65 test_expect_success
'lookup non-existing entry' '
67 echoid append 88 44 aa 55 &&
69 } | test-tool oid-array >actual &&
74 test_expect_success
'lookup with duplicates' '
76 echoid append 88 44 aa 55 &&
77 echoid append 88 44 aa 55 &&
78 echoid append 88 44 aa 55 &&
80 } | test-tool oid-array >actual &&
86 test_expect_success
'lookup non-existing entry with duplicates' '
88 echoid append 88 44 aa 55 &&
89 echoid append 88 44 aa 55 &&
90 echoid append 88 44 aa 55 &&
92 } | test-tool oid-array >actual &&
97 test_expect_success
'lookup with almost duplicate values' '
99 root=$(echoid "" 55) &&
104 echo "append $id1" &&
105 echo "append $id2" &&
107 } | test-tool oid-array >actual &&
112 test_expect_success
'lookup with single duplicate value' '
114 echoid append 55 55 &&
116 } | test-tool oid-array >actual &&