| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# This is a flipdiff(1) testcase. |
| 4 |
# We must give an error in this case, or else complete it successfully. |
| 5 |
# An error is acceptable. |
| 6 |
|
| 7 |
|
| 8 |
. ${top_srcdir-.}/tests/common.sh |
| 9 |
|
| 10 |
cat << EOF > patch1 |
| 11 |
--- file.orig |
| 12 |
+++ file |
| 13 |
@@ -5,7 +5,7 @@ |
| 14 |
Changed this. |
| 15 |
|
| 16 |
Changed that. |
| 17 |
-Borke it. |
| 18 |
+Broke it. |
| 19 |
|
| 20 |
Fixed it again. |
| 21 |
Fixed it. |
| 22 |
EOF |
| 23 |
|
| 24 |
cat << EOF > patch2 |
| 25 |
--- file.orig |
| 26 |
+++ file |
| 27 |
@@ -13,3 +13,3 @@ |
| 28 |
Blah |
| 29 |
-blah |
| 30 |
+Blah |
| 31 |
Blah |
| 32 |
@@ -17,6 +17,7 @@ |
| 33 |
Blah |
| 34 |
Blah |
| 35 |
Blah |
| 36 |
+Foo |
| 37 |
Blah |
| 38 |
Blah |
| 39 |
Blah |
| 40 |
EOF |
| 41 |
|
| 42 |
${FLIPDIFF} patch1 patch2 > patch-flipped 2>errors |
| 43 |
if [ "$?" -ne 0 ] |
| 44 |
then |
| 45 |
[ -s errors ] |
| 46 |
exit $? |
| 47 |
fi |
| 48 |
|
| 49 |
cmp - patch-flipped << EOF || exit 1 |
| 50 |
--- file.orig |
| 51 |
+++ file |
| 52 |
@@ -13,3 +13,3 @@ |
| 53 |
Blah |
| 54 |
-blah |
| 55 |
+Blah |
| 56 |
Blah |
| 57 |
@@ -17,6 +17,7 @@ |
| 58 |
Blah |
| 59 |
Blah |
| 60 |
Blah |
| 61 |
+Foo |
| 62 |
Blah |
| 63 |
Blah |
| 64 |
Blah |
| 65 |
|
| 66 |
=== 8< === cut here === 8< === |
| 67 |
|
| 68 |
--- file.orig |
| 69 |
+++ file |
| 70 |
@@ -5,7 +5,7 @@ |
| 71 |
Changed this. |
| 72 |
|
| 73 |
Changed that. |
| 74 |
-Borke it. |
| 75 |
+Broke it. |
| 76 |
|
| 77 |
Fixed it again. |
| 78 |
Fixed it. |
| 79 |
EOF |