Debian Codegraph @

tests/unwrapdiff1/run-test

raw
1 #!/bin/sh
2
3 # This is an unwrapdiff(1) testcase.
4 # Test: To see if it works at all.
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat <<EOF > patch1
10 --- file date
11 wrapped
12 +++ file date
13 wrapped
14 @@ -1 +1 @@
15 -long line that wraps
16 because it is so long
17 +other line
18 EOF
19
20 ${UNWRAPDIFF} patch1 > patch1-unwrapped || exit 1
21
22 cat <<EOF | cmp - patch1-unwrapped || exit 1
23 --- file date wrapped
24 +++ file date wrapped
25 @@ -1 +1 @@
26 -long line that wraps because it is so long
27 +other line
28 EOF
29
30 cat <<EOF > patch2
31 --- file
32 +++ file
33 @@ -1,3 +1,3 @@ does this work?
34 unchanged
35 -these two lines are changed
36 -and this one has a line of ****************
37 ********s
38 +This is changed.
39 +So is this one
40 but this wrap is ambiguous.
41 EOF
42
43 ${UNWRAPDIFF} patch2 > patch2-unwrapped || exit 1
44
45 cat <<EOF | cmp - patch2-unwrapped || exit 1
46 --- file
47 +++ file
48 @@ -1,3 +1,3 @@ does this work?
49 unchanged
50 -these two lines are changed
51 -and this one has a line of ************************s
52 +This is changed.
53 +So is this one but this wrap is ambiguous.
54 EOF