8 top="$(WVPASS pwd)" || exit $?
9 tmpdir="$(WVPASS wvmktempdir)" || exit $?
10 export BUP_DIR="$tmpdir/bup"
12 bup() { "$top/bup" "$@"; }
18 WVSTART "split --noop"
19 WVPASS bup split --noop <"$top/t/testfile1" >noop.tmp
20 WVPASSEQ '' "$(<noop.tmp)"
21 WVPASS bup split --noop -b <"$top/t/testfile1" >tags1n.tmp
22 WVPASS bup split --noop -t <"$top/t/testfile2" >tags2tn.tmp
23 WVPASSEQ $(find "$BUP_DIR/objects/pack" -name '*.pack' | wc -l) 0
28 WVPASS bup split -b a.tmp >taga.tmp
29 WVPASS bup split -b b.tmp >tagb.tmp
30 WVPASS cat a.tmp b.tmp | WVPASS bup split -b >tagab.tmp
31 WVPASSEQ $(cat taga.tmp | wc -l) 1
32 WVPASSEQ $(cat tagb.tmp | wc -l) 1
33 WVPASSEQ $(cat tagab.tmp | wc -l) 1
34 WVPASSEQ $(cat tag[ab].tmp | wc -l) 2
35 WVPASSEQ "$(bup split -b a.tmp b.tmp)" "$(cat tagab.tmp)"
36 WVPASSEQ "$(bup split -b --keep-boundaries a.tmp b.tmp)" "$(cat tag[ab].tmp)"
37 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --keep-boundaries --git-ids)" \
39 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --git-ids)" \
41 WVPASS bup split --bench -b <"$top/t/testfile1" >tags1.tmp
42 WVPASS bup split -vvvv -b "$top/t/testfile2" >tags2.tmp
43 WVPASS echo -n "" | WVPASS bup split -n split_empty_string.tmp
46 WVPASS bup midx --check -a
47 WVPASS bup midx -o "$BUP_DIR/objects/pack/test1.midx" \
48 "$BUP_DIR"/objects/pack/*.idx
49 WVPASS bup midx --check -a
50 WVPASS bup midx -o "$BUP_DIR"/objects/pack/test1.midx \
51 "$BUP_DIR"/objects/pack/*.idx \
52 "$BUP_DIR"/objects/pack/*.idx
53 WVPASS bup midx --check -a
54 all=$(echo "$BUP_DIR"/objects/pack/*.idx "$BUP_DIR"/objects/pack/*.midx)
55 WVPASS bup midx -o "$BUP_DIR"/objects/pack/zzz.midx $all
57 WVPASS bup midx -o "$BUP_DIR"/objects/pack/yyy.midx $all
59 WVPASSEQ "$(echo "$BUP_DIR"/objects/pack/*.midx)" \
60 ""$BUP_DIR"/objects/pack/yyy.midx"
62 WVPASS bup split -t "$top/t/testfile2" >tags2t.tmp
63 WVPASS bup split -t "$top/t/testfile2" --fanout 3 >tags2tf.tmp
64 WVPASS bup split -r "$BUP_DIR" -c "$top/t/testfile2" >tags2c.tmp
65 WVPASS bup split -r ":$BUP_DIR" -c "$top/t/testfile2" >tags2c.tmp
67 | WVPASS bup split -r ":$BUP_DIR" -c --fanout 3 --max-pack-objects 3 -n lslr \
70 WVFAIL bup ls /does-not-exist
72 WVPASS bup ls /lslr/latest
73 WVPASS bup ls /lslr/latest/
74 #WVPASS bup ls /lslr/1971-01-01 # all dates always exist
75 WVFAIL diff -u tags1.tmp tags2.tmp
76 WVPASS diff -u tags1.tmp tags1n.tmp
77 WVPASS diff -u tags2t.tmp tags2tn.tmp
79 # fanout must be different from non-fanout
80 WVFAIL diff tags2t.tmp tags2tf.tmp
81 WVPASS wc -c "$top/t/testfile1" "$top/t/testfile2"
82 WVPASS wc -l tags1.tmp tags2.tmp
85 WVPASS bup join $(cat tags1.tmp) >out1.tmp
86 WVPASS bup join <tags2.tmp >out2.tmp
87 WVPASS bup join <tags2t.tmp -o out2t.tmp
88 WVPASS bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
89 WVPASS bup join -r ":$BUP_DIR" <tags2c.tmp >out2c.tmp
90 WVPASS diff -u "$top/t/testfile1" out1.tmp
91 WVPASS diff -u "$top/t/testfile2" out2.tmp
92 WVPASS diff -u "$top/t/testfile2" out2t.tmp
93 WVPASS diff -u "$top/t/testfile2" out2c.tmp
94 WVPASSEQ "$(bup join split_empty_string.tmp)" ""
96 WVPASS rm -rf "$tmpdir"