# Copyright 2024-2025 Free Software Foundation, Inc.
#
# Copying and distribution of this file, with or without modification,
# in any medium, are permitted without royalty provided the copyright
# notice and this notice are preserved.

. $srcdir/test-lib.sh

require cat
use_local_patch
use_tmpdir

# ==============================================================

# Patch missing the traditional "--- old\n+++ new\n" header

cat > test <<\EOF
m
n
o
EOF

cat > test.diff <<\EOF
*** a/test	Tue Sep  3 17:39:19 2024
--- b/test	Tue Sep  3 17:39:26 2024
***************
***  1 ,	 3  ****
  m
! n
  o
--- 1	,	3 ----
  m
! o
  o
EOF

check 'patch -p1 -i test.diff' <<\EOF
patching file test
EOF

check 'cat test' <<\EOF
m
o
o
EOF
