summaryrefslogtreecommitdiffstats
path: root/src/grep/tests/context-0
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/grep/tests/context-027
1 files changed, 27 insertions, 0 deletions
diff --git a/src/grep/tests/context-0 b/src/grep/tests/context-0
new file mode 100755
index 0000000..4b63305
--- /dev/null
+++ b/src/grep/tests/context-0
@@ -0,0 +1,27 @@
+#!/bin/sh
+# 0 lines of context
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+cat <<EOF > in || framework_failure_
+needle
+1st line of context
+2nd line of context
+3rd line of context
+another needle
+5th line of context relative to first match
+6th line...
+EOF
+
+cat <<EOF > exp || framework_failure_
+needle
+--
+another needle
+EOF
+
+fail=0
+grep -C 0 needle in > out 2>err || fail=1
+
+compare exp out || fail=1
+compare /dev/null err || fail=1
+
+Exit $fail