summaryrefslogtreecommitdiff
path: root/tests/fifo
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fifo')
-rw-r--r--tests/fifo42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/fifo b/tests/fifo
new file mode 100644
index 0000000..d6f0cc8
--- /dev/null
+++ b/tests/fifo
@@ -0,0 +1,42 @@
+# Copyright (C) 2009 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.
+
+# Don't recognize hunks before a filename has been specified/seen
+
+. $srcdir/test-lib.sh
+
+require_cat
+use_local_patch
+use_tmpdir
+
+# ==============================================================
+
+cat > f.diff <<EOF
+--- /dev/null
++++ f
+@@ -0,0 +1 @@
++f
+EOF
+
+check 'patch --dry-run < f.diff' <<EOF
+patching file f
+EOF
+
+check 'patch --dry-run -i f.diff' <<EOF
+patching file f
+EOF
+
+mkfifo fifo
+
+cat f.diff > fifo &
+check 'patch --dry-run < fifo' <<EOF
+patching file f
+EOF
+
+cat f.diff > fifo &
+check 'patch --dry-run -i fifo' <<EOF
+patching file f
+EOF