1#! /bin/sh
2
3## sep_subst.sh:
4#     Make sure that the delta information substituted for
5#     each line is the information for the delta that we are
6#     actually getting, not the delta information for the delta
7#     which last touched that line.
8
9# Import common functions & definitions.
10. ../../common/test-common
11
12
13f=1test
14s=s.$f
15p=p.$f
16remove $f $s $p
17
18echo "line1 %I%" >  $f
19echo "line2" >> $f
20
21docommand prep1 "$admin -n -i$f $s" 0 "" IGNORE
22test -r $s         || fail admin could not create $s
23
24remove $f
25
26# Make a new delta
27docommand prep2 "$get -e $s" 0 "1.1\nnew delta 1.2\n2 lines\n" ""
28
29echo "line3 %I%" >> $f
30docommand prep3 "$delta '-yAdded line three' $s" 0 \
31    "1.2\n1 inserted\n0 deleted\n2 unchanged\n" \
32    IGNORE
33
34
35docommand G1 "${vg_get} -p -r1.1 $s" 0 "line1 1.1\nline2\n" \
36	    "1.1\n2 lines\n"
37docommand G2 "${vg_get} -p -r1.2 $s" 0 "line1 1.2\nline2\nline3 1.2\n" \
38	    "1.2\n3 lines\n"
39
40
41
42remove command.log
43remove $f $s $p
44success
45