8 top="$(WVPASS /bin/pwd)" || exit $?
9 tmpdir="$(WVPASS wvmktempdir)" || exit $?
10 export BUP_DIR="$tmpdir/bup"
12 bup() { "$top/bup" "$@"; }
21 WVPASS bup split -b a.tmp >taga.tmp
22 WVPASS bup split -b b.tmp >tagb.tmp
23 WVPASS cat a.tmp b.tmp | WVPASS bup split -b >tagab.tmp
24 WVPASSEQ $(cat taga.tmp | wc -l) 1
25 WVPASSEQ $(cat tagb.tmp | wc -l) 1
26 WVPASSEQ $(cat tagab.tmp | wc -l) 1
27 WVPASSEQ $(cat tag[ab].tmp | wc -l) 2
28 WVPASSEQ "$(bup split -b a.tmp b.tmp)" "$(cat tagab.tmp)"
29 WVPASSEQ "$(bup split -b --keep-boundaries a.tmp b.tmp)" "$(cat tag[ab].tmp)"
30 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --keep-boundaries --git-ids)" \
32 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --git-ids)" \
34 WVPASS bup split --bench -b <"$top/t/testfile1" >tags1.tmp
35 WVPASS bup split -vvvv -b "$top/t/testfile2" >tags2.tmp
36 WVPASS echo -n "" | WVPASS bup split -n split_empty_string.tmp
39 WVPASS bup midx --check -a
40 WVPASS bup midx -o "$BUP_DIR/objects/pack/test1.midx" \
41 "$BUP_DIR"/objects/pack/*.idx
42 WVPASS bup midx --check -a
43 WVPASS bup midx -o "$BUP_DIR"/objects/pack/test1.midx \
44 "$BUP_DIR"/objects/pack/*.idx \
45 "$BUP_DIR"/objects/pack/*.idx
46 WVPASS bup midx --check -a
47 all=$(echo "$BUP_DIR"/objects/pack/*.idx "$BUP_DIR"/objects/pack/*.midx)
48 WVPASS bup midx -o "$BUP_DIR"/objects/pack/zzz.midx $all
50 WVPASS bup midx -o "$BUP_DIR"/objects/pack/yyy.midx $all
52 WVPASSEQ "$(echo "$BUP_DIR"/objects/pack/*.midx)" \
53 ""$BUP_DIR"/objects/pack/yyy.midx"
55 WVPASS bup split -t "$top/t/testfile2" >tags2t.tmp
56 WVPASS bup split -t "$top/t/testfile2" --fanout 3 >tags2tf.tmp
57 WVPASS bup split -r "$BUP_DIR" -c "$top/t/testfile2" >tags2c.tmp
58 WVPASS bup split -r ":$BUP_DIR" -c "$top/t/testfile2" >tags2c.tmp
60 | WVPASS bup split -r ":$BUP_DIR" -c --fanout 3 --max-pack-objects 3 -n lslr \
63 WVFAIL bup ls /does-not-exist
65 WVPASS bup ls /lslr/latest
66 WVPASS bup ls /lslr/latest/
67 #WVPASS bup ls /lslr/1971-01-01 # all dates always exist
68 WVFAIL diff -u tags1.tmp tags2.tmp
70 # fanout must be different from non-fanout
71 WVFAIL diff tags2t.tmp tags2tf.tmp
72 WVPASS wc -c "$top/t/testfile1" "$top/t/testfile2"
73 WVPASS wc -l tags1.tmp tags2.tmp
76 WVPASS bup join $(cat tags1.tmp) >out1.tmp
77 WVPASS bup join <tags2.tmp >out2.tmp
78 WVPASS bup join <tags2t.tmp -o out2t.tmp
79 WVPASS bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
80 WVPASS bup join -r ":$BUP_DIR" <tags2c.tmp >out2c.tmp
81 WVPASS diff -u "$top/t/testfile1" out1.tmp
82 WVPASS diff -u "$top/t/testfile2" out2.tmp
83 WVPASS diff -u "$top/t/testfile2" out2t.tmp
84 WVPASS diff -u "$top/t/testfile2" out2c.tmp
85 WVPASSEQ "$(bup join split_empty_string.tmp)" ""
87 WVPASS rm -rf "$tmpdir"