t1340: test topgit_msg_prepare.awk functionality
[topgit/pro.git] / t / t1340-awk-topgit_msg_prepare.sh
blob8df06b3385ba0fd70416b06babd3d4a75a104ab0
1 #!/bin/sh
3 test_description='topgit_msg_prepare.awk functionality'
5 TEST_NO_CREATE_REPO=1
7 . ./test-lib.sh
9 ap="$(tg --awk-path)" && test -n "$ap" && test -d "$ap" || die
10 aptmp="$ap/topgit_msg_prepare"
11 test -f "$aptmp" && test -r "$aptmp" && test -x "$aptmp" || die
13 # Example use of topgit_msg_prepare:
15 # $ printf "%s\n" "refs/heads/{top-bases}/t/sample" |
16 # awk -f "$(tg --awk-path)/ref_prepare" \
17 # -v "topbases=refs/heads/{top-bases}" \
18 # -v "chkblob=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391" -v "depsblob=1" \
19 # -v "msgblob=1" | tee /dev/stderr |
20 # git cat-file --batch-check="%(objectname) %(objecttype) %(rest)" |
21 # tee /dev/stderr |
22 # awk -f "$(tg --awk-path)/topgit_msg_prepare" \
23 # -v "missing=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391" \
24 # -v "depsblob=2"
26 # e69de29bb2d1d6434b8b29ae775ad8c2e48c5391^{blob} check ?
27 # refs/heads/{top-bases}/t/sample t/sample :
28 # refs/heads/{top-bases}/t/sample^0
29 # refs/heads/t/sample^0
30 # refs/heads/{top-bases}/t/sample^{tree}
31 # refs/heads/t/sample^{tree}
32 # refs/heads/t/sample^{tree}:.topdeps
33 # refs/heads/t/sample^{tree}:.topmsg
35 # e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 blob check ?
36 # 9769d34b6ee3d539e4152f2629ec16c56108f82c commit t/sample :
37 # 9769d34b6ee3d539e4152f2629ec16c56108f82c commit
38 # d95cc1ed8dc6dcee3002573ca94e1d07f23889d0 commit
39 # 1afd3b1f70a1155465d1635a76fa49f96d23db2f tree
40 # 59344164440d5f71cb204b464c45ae4a14416b54 tree
41 # 2466de6787619f47fe41ced8608998462317f209 blob
42 # 5e6bd1db23329803939ffa1e1f9052e678ea4a06 blob
44 # 5e6bd1db23329803939ffa1e1f9052e678ea4a06 0 t/sample
46 # Note that topgit_msg_prepare does not concern itself with the actual value
47 # of any of the hashes (other than for equality testing), but it does care
48 # about object types and whether things are "missing" or not.
50 # It also doesn't detect obviously corrupt input (both commits are the same
51 # but their trees are not).
53 test_plan 30
55 chkmb="checkblob"
56 cat <<-EOT >"$chkmb"
57 12345678 blob check ?
58 EOT
60 cmd0="cmd0"
61 cat <<-EOT >"$cmd0" || die
62 10000000 whatever cmd0 :
63 10000002 commit
64 10000003 commit
65 10000004 tree
66 10000005 tree
67 10000006 blob
68 10000007 blob
69 EOT
70 echo "10000006 0 cmd0" >"$cmd0.out0" || die
71 echo "10000007 0 cmd0" >"$cmd0.out1" || die
72 echo "cmd0" >"$cmd0.br" || die
74 cmd1="cmd1"
75 cat <<-EOT >"$cmd1" || die
76 10000000 whatever cmd1 :
77 10000002 commit
78 10000003 commit
79 10000004 tree
80 10000005 tree
81 10000006 tag
82 10000007 missing
83 EOT
85 cmd2="cmd2"
86 cat <<-EOT >"$cmd2" || die
87 10000000 whatever cmd2 :
88 10000002 commit
89 10000003 commit
90 10000004 tree
91 10000004 tree
92 10000006 missing
93 10000007 missing
94 EOT
96 cmd3="cmd3"
97 cat <<-EOT >"$cmd3" || die
98 10000000 whatever cmd3 :
99 10000002 commit
100 10000002 commit
101 10000004 tree
102 10000004 tree
103 10000006 missing
104 10000007 missing
107 cmd4="cmd4"
108 cat <<-EOT >"$cmd4" || die
109 10000000 whatever cmd4 :
110 10000002 commit
111 10000003 commit
112 10000004 tree
113 10000005 tree
114 10000006 missing
115 10000007 missing
118 data1="data1"
119 cat <<-EOT >"$data1" || die
120 10000000 garbage
121 more garbage here
122 even more garbage here
123 yup missing it :
124 20000001 whatever k0 :
125 20000002 commit
126 20000003 commit
127 20000004 tree
128 20000005 tree
129 20000007 blob
130 30000001 whatever k1 :
131 30000002 commit
132 30000003 commit
133 30000004 tree
134 30000005 tree
135 30000007 missing
136 40000001 whatever k2 :
137 40000002 commit
138 40000003 commit
139 40000004 tree
140 40000004 tree
141 40000007 blob
142 50000001 whatever k3 :
143 50000002 commit
144 50000002 commit
145 50000004 tree
146 50000004 tree
147 50000007 blob
148 60000001 whatever k4 :
149 60000002 commit
150 60000003 commit
151 60000004 tree
152 60000005 tree
153 60000007 missing
156 data2="data2"
157 cat <<-EOT >"$data2" || die
158 10000000 garbage
159 more garbage here
160 even more garbage here
161 yup missing it :
162 20000001 whatever k0 :
163 20000002 commit
164 20000003 commit
165 20000004 tree
166 20000005 tree
167 20000006 blob
168 20000007 blob
169 30000001 whatever k1 :
170 30000002 commit
171 30000003 commit
172 30000004 tree
173 30000005 tree
174 30000006 blob
175 30000007 missing
176 40000001 whatever k2 :
177 40000002 commit
178 40000003 commit
179 40000004 tree
180 40000004 tree
181 40000006 blob
182 40000007 blob
183 50000001 whatever k3 :
184 50000002 commit
185 50000002 commit
186 50000004 tree
187 50000004 tree
188 50000006 blob
189 50000007 blob
190 60000001 whatever k4 :
191 60000002 commit
192 60000003 commit
193 60000004 tree
194 60000005 tree
195 60000006 missing
196 60000007 missing
199 data3="data3"
200 cat <<-EOT >"$data3" || die
201 10000000 garbage
202 more garbage here
203 even more garbage here
204 yup missing it :
205 20000001 whatever k0 :
206 20000002 commit
207 20000003 commit
208 20000004 tree
209 20000005 tree
210 20000006 tag
211 20000007 blob
212 30000001 whatever k1 :
213 30000002 commit
214 30000003 commit
215 30000004 tree
216 30000005 tree
217 30000006 tag
218 30000007 missing
219 40000001 whatever k2 :
220 40000002 commit
221 40000003 commit
222 40000004 tree
223 40000004 tree
224 40000006 tag
225 40000007 blob
226 50000001 whatever k3 :
227 50000002 commit
228 50000002 commit
229 50000004 tree
230 50000004 tree
231 50000006 tag
232 50000007 blob
233 60000001 whatever k4 :
234 60000002 commit
235 60000003 commit
236 60000004 tree
237 60000005 tree
238 60000006 missing
239 60000007 missing
241 cat <<-EOT >"$data3.d0"
242 other^{blob} 1 k0
243 other^{blob} 1 k1
244 other^{blob} 2 k2
245 other^{blob} 3 k3
246 other^{blob} 1 k4
248 cat <<-EOT >"$data3.d1"
249 20000007 0 k0
250 other^{blob} 1 k1
251 other^{blob} 2 k2
252 other^{blob} 3 k3
253 other^{blob} 1 k4
255 cat <<-EOT >"$data3.d2"
256 20000007 0 k0
257 other^{blob} 1 k1
258 other^{blob} 2 k2
259 other^{blob} 3 k3
260 other^{blob} 4 k4
263 data3r="data3r"
264 cat <<-EOT >"$data3r" || die
265 10000000 garbage
266 more garbage here
267 even more garbage here
268 yup missing it :
269 20000001 whatever k0 :
270 20000002 commit
271 20000003 commit
272 20000004 tree
273 20000005 tree
274 20000007 blob
275 20000006 tag
276 30000001 whatever k1 :
277 30000002 commit
278 30000003 commit
279 30000004 tree
280 30000005 tree
281 30000007 missing
282 30000006 tag
283 40000001 whatever k2 :
284 40000002 commit
285 40000003 commit
286 40000004 tree
287 40000004 tree
288 40000007 blob
289 40000006 tag
290 50000001 whatever k3 :
291 50000002 commit
292 50000002 commit
293 50000004 tree
294 50000004 tree
295 50000007 blob
296 50000006 tag
297 60000001 whatever k4 :
298 60000002 commit
299 60000003 commit
300 60000004 tree
301 60000005 tree
302 60000007 missing
303 60000006 missing
305 cat <<-EOT >"$data3r.d0"
306 20000007 0 k0
307 other^{blob} 1 k1
308 other^{blob} 2 k2
309 other^{blob} 3 k3
310 other^{blob} 1 k4
312 cat <<-EOT >"$data3r.d1"
313 other^{blob} 1 k0
314 other^{blob} 1 k1
315 other^{blob} 2 k2
316 other^{blob} 3 k3
317 other^{blob} 1 k4
319 cat <<-EOT >"$data3r.d2"
320 other^{blob} 1 k0
321 other^{blob} 1 k1
322 other^{blob} 2 k2
323 other^{blob} 3 k3
324 other^{blob} 4 k4
327 mt_base="one-rather-lengthy-and-unlikely-blob-name-for-sure"
329 test_expect_success 'test setup' '
330 branch_base="some-very-long-branch-base-name-goes-here-for-sure" &&
331 bn=10000000 &&
332 >biginput && >bigoutput && >bigbrfile &&
333 i=1 && while i=$(($i + 10)) && test $i -le 10000; do
334 printf "%08d whatever %s-%d :\n" $(( $bn + $i )) "$branch_base" $(( $bn + $i )) >>biginput &&
335 printf "%08d commit\n" $(( $bn + $i + 1 )) >>biginput &&
336 printf "%08d commit\n" $(( $bn + $i + 2 )) >>biginput &&
337 printf "%08d tree\n" $(( $bn + $i + 3 )) >>biginput &&
338 printf "%08d tree\n" $(( $bn + $i + 3 )) >>biginput &&
339 printf "%08d blob\n" $(( $bn + $i + 4 )) >>biginput &&
340 printf "%s-%d\n" "$branch_base" $(( $bn + $i )) >>bigbrfile &&
341 printf "%s^{blob} 2 %s-%d\n" "$mt_base" "$branch_base" $(( $bn + $i )) >>bigoutput
342 done &&
343 cat bigbrfile bigoutput >bigcombined
346 test_expect_success 'topgit_msg_prepare runs' '
347 # some stupid awks might not even compile it
348 awk -f "$aptmp" </dev/null &&
349 # and make sure various file arg combinations are accepted
350 awk -f "$aptmp" </dev/null -v brfile=brfile && rm -f brfile &&
351 awk -f "$aptmp" </dev/null -v anfile=anfile && rm -f anfile &&
352 awk -f "$aptmp" </dev/null -v brfile=brfile -v anfile=anfile
355 test_expect_success 'output files always truncated' '
356 echo brfile > brfile && test -s brfile &&
357 echo anfile > anfile && test -s anfile &&
358 awk -f "$aptmp" </dev/null -v brfile=brfile -v anfile=anfile &&
359 test ! -s brfile &&
360 test ! -s anfile
363 capture() {
364 IFS= read -r line || return &&
365 cat "$1" >"$2" &&
366 printf '%s\n' "$line" >>"$2" &&
367 cat >>"$2"
370 test_expect_success 'output brfile ordering' '
371 >result &&
372 awk -f "$aptmp" <biginput -v withan=1 -v missing="$mt_base" -v brfile=brfile | capture brfile result &&
373 test_cmp result bigcombined
376 test_expect_success 'output anfile ordering' '
377 >result &&
378 awk -f "$aptmp" <biginput -v withan=1 -v missing="$mt_base" -v anfile=anfile | capture anfile result &&
379 test_cmp result bigcombined
382 test_expect_success 'anfile only' '
383 awk -f "$aptmp" <biginput -v anfile=anlist >out &&
384 test ! -s out && test_cmp anlist bigbrfile
387 test_expect_success 'anfile only one out' '
388 cat "$cmd0" biginput | awk -f "$aptmp" -v anfile=anlist >out &&
389 test_cmp out "$cmd0.out0" && test_cmp anlist bigbrfile
392 test_expect_success 'empty brfile only' '
393 awk -f "$aptmp" <biginput -v brfile=brlist >out &&
394 test ! -s out && test -e brlist && test ! -s brlist
397 test_expect_success 'one in brfile only' '
398 cat "$cmd0" biginput | awk -f "$aptmp" -v brfile=brlist >out &&
399 test_cmp out "$cmd0.out0" && test_cmp brlist "$cmd0.br"
402 test_expect_success 'withan=1 brfile only' '
403 awk -f "$aptmp" <biginput -v withan=1 -v brfile=brlist >out &&
404 test ! -s out && test_cmp brlist bigbrfile
407 test_expect_success 'anfile and empty brfile' '
408 awk -f "$aptmp" <biginput -v anfile=anlist -v brfile=brlist >out &&
409 test ! -s out && test_cmp anlist bigbrfile && test -e brlist && test ! -s brlist
412 test_expect_success 'anfile and one in brfile' '
413 cat "$cmd0" biginput | awk -f "$aptmp" -v anfile=anlist -v brfile=brlist >out &&
414 test_cmp out "$cmd0.out0" && test_cmp anlist bigbrfile && test_cmp brlist "$cmd0.br"
417 # The only kind of "bad" input that's detected is not enough lines after
418 # the starting 4-field ':' line
419 test_expect_success 'bad input detected' '
420 echo "0001 commit branch :" >input &&
421 test_must_fail awk -f "$aptmp" <input &&
422 echo "0002 commit" >>input &&
423 test_must_fail awk -f "$aptmp" <input &&
424 echo "0003 commit" >>input &&
425 test_must_fail awk -f "$aptmp" <input &&
426 echo "0004 tree" >>input &&
427 test_must_fail awk -f "$aptmp" <input &&
428 echo "0005 tree" >>input &&
429 test_must_fail awk -f "$aptmp" <input &&
430 echo "0006 blob" >>input &&
431 awk -f "$aptmp" <input &&
432 test_must_fail awk -f "$aptmp" <input -v depsblob=1 &&
433 test_must_fail awk -f "$aptmp" <input -v depsblob=2 &&
434 echo "0007 blob" >>input &&
435 awk -f "$aptmp" <input &&
436 awk -f "$aptmp" <input -v depsblob=1 &&
437 awk -f "$aptmp" <input -v depsblob=2
440 test_expect_success 'missing command does not run' '
441 rm -f run* &&
442 awk -f "$aptmp" <"$cmd0" -v misscmd="echo r0>>run0" >out0 &&
443 awk -f "$aptmp" <"$cmd0" -v depsblob=1 -v misscmd="echo r0>>run0" >out1 &&
444 test_cmp "$cmd0.out0" out0 && test_cmp "$cmd0.out1" out1 && test ! -e run0 &&
445 awk -f "$aptmp" <"$cmd1" -v depsblob=1 -v misscmd="echo r1>>run1" >out &&
446 test ! -s out && test ! -e run1 &&
447 awk -f "$aptmp" <"$cmd2" -v misscmd="echo r2>>run2" >out &&
448 awk -f "$aptmp" <"$cmd2" -v missing=other -v misscmd="echo r2>>run2" >>out &&
449 awk -f "$aptmp" <"$cmd2" -v withmt=1 -v missing=other -v misscmd="echo r2>>run2" >>out &&
450 test ! -s out && test ! -e run2 &&
451 awk -f "$aptmp" <"$cmd3" -v misscmd="echo r3>>run3" >out &&
452 awk -f "$aptmp" <"$cmd3" -v missing=other -v misscmd="echo r3>>run3" >>out &&
453 awk -f "$aptmp" <"$cmd3" -v withan=1 -v withmt=0 -v missing=other -v misscmd="echo r3>>run3" >>out &&
454 test ! -s out && test ! -e run3 &&
455 awk -f "$aptmp" <"$cmd4" -v misscmd="echo r4>>run4" >out &&
456 test ! -s out && test ! -e run4 &&
457 cat "$chkmb" "$cmd0" | awk -f "$aptmp" -v missing=12345678 -v misscmd="echo r0>>run0" >out0a &&
458 cat "$chkmb" "$cmd0" | awk -f "$aptmp" -v missing=other -v misscmd="echo r0>>run0" >out0b &&
459 test_cmp "$cmd0.out0" out0a && test_cmp "$cmd0.out0" out0b &&
460 test ! -e run0 &&
461 echo "12345678^{blob} 1 cmd1" >expected &&
462 cat "$chkmb" "$cmd1" | awk -f "$aptmp" -v depsblob=1 -v missing=12345678 -v misscmd="echo r1>>run1" >out &&
463 test ! -e run1 && test_cmp out expected &&
464 echo "12345678^{blob} 2 cmd2" >expected &&
465 cat "$chkmb" "$cmd2" | awk -f "$aptmp" -v withan=1 -v missing=12345678 -v misscmd="echo r2>>run2" >out &&
466 test ! -e run2 && test_cmp out expected &&
467 echo "12345678^{blob} 3 cmd3" >expected &&
468 cat "$chkmb" "$cmd3" | awk -f "$aptmp" -v withmt=1 -v missing=12345678 -v misscmd="echo r3>>run3" >out &&
469 test ! -e run3 && test_cmp out expected &&
470 echo "12345678^{blob} 1 cmd4" >expected &&
471 echo "12345678^{blob} 1 cmd4" >>expected &&
472 echo "12345678^{blob} 4 cmd4" >>expected &&
473 cat "$chkmb" "$cmd4" | awk -f "$aptmp" -v missing=12345678 -v misscmd="echo r4>>run4" >out &&
474 cat "$chkmb" "$cmd4" | awk -f "$aptmp" -v missing=12345678 -v misscmd="echo r4>>run4" -v depsblob=1 >>out &&
475 cat "$chkmb" "$cmd4" | awk -f "$aptmp" -v missing=12345678 -v misscmd="echo r4>>run4" -v depsblob=2 >>out &&
476 test ! -e run4 && test_cmp out expected
479 test_expect_success 'missing command does run' '
480 rm -f run* &&
481 <"$cmd1" awk -f "$aptmp" -v depsblob=1 -v missing=12345678 -v misscmd="echo r1>>run1" &&
482 test -s run1 && read -r l <run1 && test "$l" = "r1" &&
483 <"$cmd2" awk -f "$aptmp" -v withan=1 -v withmt=0 -v missing=12345678 -v misscmd="echo r2>>run2" &&
484 test -s run2 && read -r l <run2 && test "$l" = "r2" &&
485 <"$cmd3" awk -f "$aptmp" -v withmt=1 -v missing=12345678 -v misscmd="echo r3>>run3" &&
486 test -s run3 && read -r l <run3 && test "$l" = "r3" &&
487 <"$cmd4" awk -f "$aptmp" -v missing=12345678 -v misscmd="echo r4a>>run4" &&
488 <"$cmd4" awk -f "$aptmp" -v missing=12345678 -v misscmd="echo r4b>>run4" -v depsblob=1 &&
489 <"$cmd4" awk -f "$aptmp" -v missing=12345678 -v misscmd="echo r4c>>run4" -v depsblob=2 &&
490 { read -r l1 && read -r l2 && read -r l3; } <run4 &&
491 test "$l1" = "r4a" && test "$l2" = "r4b" && test "$l3" = "r4c"
494 test_expect_success 'missing command runs once' '
495 rm -f run* &&
496 cat "$cmd1" "$cmd2" "$cmd3" "$cmd4" |
497 awk -f "$aptmp" -v depsblob=2 -v withan=1 -v missing=12345678 -v misscmd="echo r1>>run1" &&
498 echo "r1" >expected &&
499 test -s run1 && test_cmp run1 expected
502 test_expect_success 'depsblob=0..2' '
503 <"$data3" awk -f "$aptmp" -v withan=1 -v missing=other >out &&
504 test_cmp out "$data3.d0" &&
505 <"$data3" awk -f "$aptmp" -v depsblob=0 -v withan=1 -v missing=other >out &&
506 test_cmp out "$data3.d0" &&
507 <"$data3" awk -f "$aptmp" -v depsblob=1 -v withan=1 -v missing=other >out &&
508 test_cmp out "$data3.d1" &&
509 <"$data3" awk -f "$aptmp" -v depsblob=2 -v withan=1 -v missing=other >out &&
510 test_cmp out "$data3.d2" &&
511 <"$data3r" awk -f "$aptmp" -v withan=1 -v missing=other >out &&
512 test_cmp out "$data3r.d0" &&
513 <"$data3r" awk -f "$aptmp" -v depsblob=0 -v withan=1 -v missing=other >out &&
514 test_cmp out "$data3r.d0" &&
515 <"$data3r" awk -f "$aptmp" -v depsblob=1 -v withan=1 -v missing=other >out &&
516 test_cmp out "$data3r.d1" &&
517 <"$data3r" awk -f "$aptmp" -v depsblob=2 -v withan=1 -v missing=other >out &&
518 test_cmp out "$data3r.d2"
521 test_expect_success 'no K=1..4 without -v missing' '
522 echo "20000007 0 k0" >expected &&
523 <"$data1" awk -f "$aptmp" >out &&
524 test_cmp out expected &&
525 <"$data1" awk -f "$aptmp" -v withan=1 >out &&
526 test_cmp out expected &&
527 <"$data1" awk -f "$aptmp" -v withmt=1 >out &&
528 test_cmp out expected &&
529 <"$data1" awk -f "$aptmp" -v withan=1 -v withmt=1 >out &&
530 test_cmp out expected
533 test_expect_success 'K=0,1 output' '
534 echo "20000007 0 k0" >expected &&
535 echo "other^{blob} 1 k1" >>expected &&
536 echo "other^{blob} 1 k4" >>expected &&
537 <"$data1" awk -f "$aptmp" -v missing=other >out &&
538 test_cmp out expected
541 test_expect_success 'K=0,1 output depsblob=1' '
542 echo "20000007 0 k0" >expected &&
543 echo "other^{blob} 1 k1" >>expected &&
544 echo "other^{blob} 1 k4" >>expected &&
545 <"$data2" awk -f "$aptmp" -v missing=other -v depsblob=1 >out &&
546 test_cmp out expected
549 test_expect_success 'K=0,1,4 output depsblob=2' '
550 echo "20000007 0 k0" >expected &&
551 echo "other^{blob} 1 k1" >>expected &&
552 echo "other^{blob} 4 k4" >>expected &&
553 <"$data2" awk -f "$aptmp" -v missing=other -v depsblob=2 >out &&
554 test_cmp out expected
556 test_expect_success 'K=0..3 output' '
557 echo "20000007 0 k0" >expected &&
558 echo "other^{blob} 1 k1" >>expected &&
559 echo "other^{blob} 2 k2" >>expected &&
560 echo "other^{blob} 3 k3" >>expected &&
561 echo "other^{blob} 1 k4" >>expected &&
562 <"$data1" awk -f "$aptmp" -v withan=1 -v missing=other >out &&
563 test_cmp out expected
566 test_expect_success 'K=0..3 output depsblob=1' '
567 echo "20000007 0 k0" >expected &&
568 echo "other^{blob} 1 k1" >>expected &&
569 echo "other^{blob} 2 k2" >>expected &&
570 echo "other^{blob} 3 k3" >>expected &&
571 echo "other^{blob} 1 k4" >>expected &&
572 <"$data2" awk -f "$aptmp" -v withan=1 -v missing=other -v depsblob=1 >out &&
573 test_cmp out expected
576 test_expect_success 'K=0..4 output depsblob=2' '
577 echo "20000007 0 k0" >expected &&
578 echo "other^{blob} 1 k1" >>expected &&
579 echo "other^{blob} 2 k2" >>expected &&
580 echo "other^{blob} 3 k3" >>expected &&
581 echo "other^{blob} 4 k4" >>expected &&
582 <"$data2" awk -f "$aptmp" -v withan=1 -v missing=other -v depsblob=4 >out &&
583 test_cmp out expected
586 test_expect_success 'K=0..2 output' '
587 echo "20000007 0 k0" >expected &&
588 echo "other^{blob} 1 k1" >>expected &&
589 echo "other^{blob} 2 k2" >>expected &&
590 echo "other^{blob} 1 k4" >>expected &&
591 <"$data1" awk -f "$aptmp" -v withan=1 -v withmt=0 -v missing=other >out &&
592 test_cmp out expected
595 test_expect_success 'K=0..2 output depsblob=1' '
596 echo "20000007 0 k0" >expected &&
597 echo "other^{blob} 1 k1" >>expected &&
598 echo "other^{blob} 2 k2" >>expected &&
599 echo "other^{blob} 1 k4" >>expected &&
600 <"$data2" awk -f "$aptmp" -v withan=1 -v withmt=0 -v missing=other -v depsblob=1 >out &&
601 test_cmp out expected
604 test_expect_success 'K=0..2,4 output depsblob=2' '
605 echo "20000007 0 k0" >expected &&
606 echo "other^{blob} 1 k1" >>expected &&
607 echo "other^{blob} 2 k2" >>expected &&
608 echo "other^{blob} 4 k4" >>expected &&
609 <"$data2" awk -f "$aptmp" -v withan=1 -v withmt=0 -v missing=other -v depsblob=2 >out &&
610 test_cmp out expected
613 test_expect_success 'K=0,1,3 output' '
614 echo "20000007 0 k0" >expected &&
615 echo "other^{blob} 1 k1" >>expected &&
616 echo "other^{blob} 3 k3" >>expected &&
617 echo "other^{blob} 1 k4" >>expected &&
618 <"$data1" awk -f "$aptmp" -v withmt=1 -v missing=other >out &&
619 test_cmp out expected
622 test_expect_success 'K=0,1,3 output depsblob=1' '
623 echo "20000007 0 k0" >expected &&
624 echo "other^{blob} 1 k1" >>expected &&
625 echo "other^{blob} 3 k3" >>expected &&
626 echo "other^{blob} 1 k4" >>expected &&
627 <"$data2" awk -f "$aptmp" -v withmt=1 -v missing=other -v depsblob=1 >out &&
628 test_cmp out expected
631 test_expect_success 'K=0,1,3,4 output depsblob=2' '
632 echo "20000007 0 k0" >expected &&
633 echo "other^{blob} 1 k1" >>expected &&
634 echo "other^{blob} 3 k3" >>expected &&
635 echo "other^{blob} 4 k4" >>expected &&
636 <"$data2" awk -f "$aptmp" -v withmt=1 -v missing=other -v depsblob=2 >out &&
637 test_cmp out expected
640 test_done