# Copyright (C) 2018 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

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

cat > ed1.diff <<EOF
0a
foo
.
EOF

check 'patch -e foo -i ed1.diff' <<EOF
EOF

check 'cat foo' <<EOF
foo
EOF

cat > ed2.diff <<EOF
1337a
r !echo bar
,p
EOF

check 'patch -e foo -i ed2.diff > /dev/null 2> /dev/null || echo "Status: $?"' <<EOF
Status: 2
EOF

check 'cat foo' <<EOF
foo
EOF
