| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# This is a flipdiff(1) testcase. |
| 4 |
|
| 5 |
|
| 6 |
. ${top_srcdir-.}/tests/common.sh |
| 7 |
|
| 8 |
cat << EOF > file1.orig |
| 9 |
a |
| 10 |
EOF |
| 11 |
|
| 12 |
cat << EOF > file1 |
| 13 |
A |
| 14 |
EOF |
| 15 |
|
| 16 |
cat << EOF > file2.orig |
| 17 |
b |
| 18 |
EOF |
| 19 |
|
| 20 |
cat << EOF > file2 |
| 21 |
B |
| 22 |
EOF |
| 23 |
|
| 24 |
${DIFF} -u file1.orig file1 > patch1 |
| 25 |
${DIFF} -u file2.orig file2 > patch2 |
| 26 |
|
| 27 |
${FLIPDIFF} patch1 patch2 > patch-flipped || exit 1 |
| 28 |
sed -e "s/$(printf '\t').*$//" patch-flipped > patch-cmp |
| 29 |
cmp - patch-cmp << EOF || exit 1 |
| 30 |
--- file2.orig |
| 31 |
+++ file2 |
| 32 |
@@ -1 +1 @@ |
| 33 |
-b |
| 34 |
+B |
| 35 |
|
| 36 |
=== 8< === cut here === 8< === |
| 37 |
|
| 38 |
--- file1.orig |
| 39 |
+++ file1 |
| 40 |
@@ -1 +1 @@ |
| 41 |
-a |
| 42 |
+A |
| 43 |
EOF |