3 test_description='check infrastructure for svn importer'
8 test_expect_success 'obj pool: store data' '
9 cat <<-\EOF >expected &&
14 test-obj-pool <<-\EOF >actual &&
20 test_cmp expected actual
23 test_expect_success 'obj pool: NULL is offset ~0' '
24 echo "$uint32_max" >expected &&
25 echo null one | test-obj-pool >actual &&
26 test_cmp expected actual
29 test_expect_success 'obj pool: out-of-bounds access' '
30 cat <<-EOF >expected &&
40 test-obj-pool <<-\EOF >actual &&
52 test_cmp expected actual
55 test_expect_success 'obj pool: high-water mark' '
56 cat <<-\EOF >expected &&
65 test-obj-pool <<-\EOF >actual &&
76 test_cmp expected actual
79 test_expect_success 'line buffer' '
80 echo HELLO >expected1 &&
81 printf "%s\n" "" HELLO >expected2 &&
83 printf "%s\n" "" Q | q_to_nul >expected4 &&
84 printf "%s\n" foo "" >expected5 &&
85 printf "%s\n" "" foo >expected6 &&
87 test-line-buffer <<-\EOF >actual1 &&
92 test-line-buffer <<-\EOF >actual2 &&
103 test-line-buffer >actual3 &&
111 test-line-buffer >actual4 &&
113 test-line-buffer <<-\EOF >actual5 &&
118 test-line-buffer <<-\EOF >actual6 &&
125 test_cmp expected1 actual1 &&
126 test_cmp expected2 actual2 &&
127 test_cmp expected3 actual3 &&
128 test_cmp expected4 actual4 &&
129 test_cmp expected5 actual5 &&
130 test_cmp expected6 actual6
133 test_expect_success 'string pool' '
134 echo a does not equal b >expected.differ &&
135 echo a equals a >expected.match &&
136 echo equals equals equals >expected.matchmore &&
138 test-string-pool "a,--b" >actual.differ &&
139 test-string-pool "a,a" >actual.match &&
140 test-string-pool "equals-equals" >actual.matchmore &&
141 test_must_fail test-string-pool a,a,a &&
142 test_must_fail test-string-pool a &&
144 test_cmp expected.differ actual.differ &&
145 test_cmp expected.match actual.match &&
146 test_cmp expected.matchmore actual.matchmore
149 test_expect_success 'treap sort' '
150 cat <<-\EOF >unsorted &&
165 sort unsorted >expected &&
167 test-treap <unsorted >actual &&
168 test_cmp expected actual