File: p-option.sh

package info (click to toggle)
cssc 1.0.1-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,612 kB
  • ctags: 1,424
  • sloc: cpp: 13,502; sh: 4,759; ansic: 2,971; perl: 342; makefile: 339; awk: 11
file content (68 lines) | stat: -rw-r--r-- 1,128 bytes parent folder | download | duplicates (7)
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
65
66
67
68
#! /bin/sh
# p-option.sh:  Testing for the -p option of "delta"

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

g=foo
s=s.$g
files="$s $g p.$g z.$g"
remove $files

# Create an SCCS file.
docommand p1 "${admin} -n $s"    0 "" IGNORE

# Check the file out for editing.
docommand p2 "${get} -e $s"      0 IGNORE IGNORE

# Append a line
echo "hello" >> $g
docommand p3 "cat $g" 0 "hello\n" ""

# Check the file back in with delta, using the -n option.
docommand p4 "${delta} -p -y $s" 0 \
"1.2
0a1
> hello
1 inserted
0 deleted
0 unchanged
" IGNORE


# Check the file out for editing again
docommand p5 "${get} -e $s"      0 IGNORE IGNORE

# Change the line.
echo "test" > $g
docommand p6 "cat $g" 0 "test\n" ""

docommand p7 "${delta} -p -y $s" 0 \
"1.3
1c1
< hello
---
> test
1 inserted
1 deleted
0 unchanged
" IGNORE


# Delete the (only) line
docommand p8 "${get} -e $s"      0 IGNORE IGNORE
true > $g
docommand p9 "cat $g" 0 "" ""

# Check the file back in with delta, using the -n option.
docommand p10 "${delta} -p -y $s" 0 \
"1.4
1d0
< test
0 inserted
1 deleted
0 unchanged
" IGNORE

remove $files
success