File: delta-summary.sh

package info (click to toggle)
cssc 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 11,368 kB
  • sloc: cpp: 39,446; ansic: 17,403; sh: 11,328; python: 3,923; makefile: 1,929; perl: 342; awk: 15; sed: 15
file content (64 lines) | stat: -rw-r--r-- 1,384 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! /bin/sh

# Import common functions & definitions.
. ../common/test-common

g=keys.txt
s=s.$g
l=l.$g
p=p.$g
remove $s $g $l $p
../../testutils/uu_decode --decode < keys.uue || miscarry could not extract test file.

summary="\
    1.2	97/10/25 23:04:58 james
	changed the one and only line

    1.1	97/10/25 23:04:20 james
	date and time created 97/10/25 23:04:20 by james
"


# Check the basic function of the -L option.
docommand L1 "${vg_get} -L s.keys.txt" 0 "$summary\n" "1.2\n1 lines\n"
remove $g

# Check that -lp does the same thing.
docommand L1p "${vg_get} -lp s.keys.txt" 0 "$summary\n" "1.2\n1 lines\n" 
remove $g

docommand L2 "${vg_get} -L s.keys.txt s.keys.txt" 0 "$summary\n$summary\n" "
s.keys.txt:
1.2
1 lines

s.keys.txt:
1.2
1 lines
"
remove $g

# Check that the "new delta" message also goes to stderr when we are using -L.
docommand L2e "${vg_get} -e -L s.keys.txt" 0 "$summary\n" "1.2
new delta 1.3
1 lines
"
# Reverse the effect of the edit.
remove $g $p

# Check that the delta summary is sent to stderr if -p is given (and that 
# the body goes to stdout)..
docommand L3 "${vg_get} -p -k -L s.keys.txt" 0 "$summary\n1.2 %I%\n" "1.2\n1 lines\n"
remove $g


# Generate an l-file ...
docommand o1a "${vg_get} -l s.keys.txt" 0 "1.2\n1 lines\n" ""

# ... and check its contents.
docommand o1b "cat $l" 0 "$summary\n" ""
remove $g $l


remove $s $g $l $p
success