diff options
Diffstat (limited to 'tests/ed-style')
-rw-r--r-- | tests/ed-style | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/ed-style b/tests/ed-style new file mode 100644 index 0000000..d8c0689 --- /dev/null +++ b/tests/ed-style @@ -0,0 +1,41 @@ +# 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 2> /dev/null || echo "Status: $?"' <<EOF +? +Status: 2 +EOF + +check 'cat foo' <<EOF +foo +EOF |