|
Packit |
709fb3 |
#!/bin/sh
|
|
Packit |
709fb3 |
# 0 lines of context
|
|
Packit |
709fb3 |
. "${srcdir=.}/init.sh"; path_prepend_ ../src
|
|
Packit |
709fb3 |
|
|
Packit |
709fb3 |
cat <<EOF > in || framework_failure_
|
|
Packit |
709fb3 |
needle
|
|
Packit |
709fb3 |
1st line of context
|
|
Packit |
709fb3 |
2nd line of context
|
|
Packit |
709fb3 |
3rd line of context
|
|
Packit |
709fb3 |
another needle
|
|
Packit |
709fb3 |
5th line of context relative to first match
|
|
Packit |
709fb3 |
6th line...
|
|
Packit |
709fb3 |
EOF
|
|
Packit |
709fb3 |
|
|
Packit |
709fb3 |
cat <<EOF > exp || framework_failure_
|
|
Packit |
709fb3 |
needle
|
|
Packit |
709fb3 |
--
|
|
Packit |
709fb3 |
another needle
|
|
Packit |
709fb3 |
EOF
|
|
Packit |
709fb3 |
|
|
Packit |
709fb3 |
fail=0
|
|
Packit |
709fb3 |
grep -C 0 needle in > out 2>err || fail=1
|
|
Packit |
709fb3 |
|
|
Packit |
709fb3 |
compare exp out || fail=1
|
|
Packit |
709fb3 |
compare /dev/null err || fail=1
|
|
Packit |
709fb3 |
|
|
Packit |
709fb3 |
Exit $fail
|