#!/bin/sh

# This is a recountdiff(1) testcase.
# Test: Test that '\' lines are handled correctly.


. ${top_srcdir-.}/tests/common.sh

cat << EOF > patch
--- file
+++ file
@@ -1 +1 @@
-1
\ No newline at end of file
+2
+3
@@ -10 +10 @@
-1
+1
--- otherfile
+++ otherfile
@@ -1 +1,2 @@
 1
-1
+2
\ No newline at end of file
@@ -10 +10 @@
-1
+1
EOF

${RECOUNTDIFF} patch > patch-recounted || exit 1
cat << EOF | cmp - patch-recounted || exit 1
--- file
+++ file
@@ -1 +1,2 @@
-1
\ No newline at end of file
+2
+3
@@ -10 +11 @@
-1
+1
--- otherfile
+++ otherfile
@@ -1,2 +1,2 @@
 1
-1
+2
\ No newline at end of file
@@ -10 +10 @@
-1
+1
EOF
