| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# This is a filterdiff(1) testcase. |
| 4 |
|
| 5 |
|
| 6 |
. ${top_srcdir-.}/tests/common.sh |
| 7 |
|
| 8 |
cat << EOF > diff |
| 9 |
--- file1 |
| 10 |
+++ file1 |
| 11 |
@@ -1,3 +1,3 @@ |
| 12 |
-Damaged patch (before) |
| 13 |
+Damaged patch (after) |
| 14 |
|
| 15 |
Previous line is damaged |
| 16 |
EOF |
| 17 |
${FILTERDIFF} --as-numbered-lines=before diff \ |
| 18 |
2>errors >file-before || exit 1 |
| 19 |
${FILTERDIFF} --as-numbered-lines=after diff \ |
| 20 |
2>>errors >file-after || exit 1 |
| 21 |
[ -s errors ] && exit 1 |
| 22 |
|
| 23 |
cat << EOF | cmp - file-before || exit 1 |
| 24 |
--- file1 |
| 25 |
1 :Damaged patch (before) |
| 26 |
2 : |
| 27 |
3 :Previous line is damaged |
| 28 |
EOF |
| 29 |
|
| 30 |
cat << EOF | cmp - file-after || exit 1 |
| 31 |
+++ file1 |
| 32 |
1 :Damaged patch (after) |
| 33 |
2 : |
| 34 |
3 :Previous line is damaged |
| 35 |
EOF |
| 36 |
|