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
'ordered enumeration' '
19 echoid "" 44 55 88 aa >expect &&
21 echoid append 88 44 aa 55 &&
23 } | test-tool oid-array >actual &&
24 test_cmp expect actual
27 test_expect_success
'ordered enumeration with duplicate suppression' '
28 echoid "" 44 55 88 aa >expect &&
30 echoid append 88 44 aa 55 &&
31 echoid append 88 44 aa 55 &&
32 echoid append 88 44 aa 55 &&
34 } | test-tool oid-array >actual &&
35 test_cmp expect actual
38 test_expect_success
'lookup' '
40 echoid append 88 44 aa 55 &&
42 } | test-tool oid-array >actual &&
47 test_expect_success
'lookup non-existing entry' '
49 echoid append 88 44 aa 55 &&
51 } | test-tool oid-array >actual &&
56 test_expect_success
'lookup with duplicates' '
58 echoid append 88 44 aa 55 &&
59 echoid append 88 44 aa 55 &&
60 echoid append 88 44 aa 55 &&
62 } | test-tool oid-array >actual &&
68 test_expect_success
'lookup non-existing entry with duplicates' '
70 echoid append 88 44 aa 55 &&
71 echoid append 88 44 aa 55 &&
72 echoid append 88 44 aa 55 &&
74 } | test-tool oid-array >actual &&
79 test_expect_success
'lookup with almost duplicate values' '
81 root=$(echoid "" 55) &&
89 } | test-tool oid-array >actual &&
94 test_expect_success
'lookup with single duplicate value' '
96 echoid append 55 55 &&
98 } | test-tool oid-array >actual &&