diff options
author | Jim Meyering <meyering@fb.com> | 2016-02-01 08:12:29 -0800 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2016-02-01 08:12:29 -0800 |
commit | 43f6246fe82f1f265662fd36044b5fa447f7a1d3 (patch) | |
tree | 00caa73e9b7d8e618c423f94194d3a0da81db0d4 | |
parent | 2982258caee17e73e1d6d439efdc9f1eccd04e28 (diff) | |
download | grep-43f6246fe82f1f265662fd36044b5fa447f7a1d3.tar.gz |
tests/null-byte: test another code path
* tests/null-byte: Also exercise the case in which there is
a match in the block along with the NUL byte.
-rwxr-xr-x | tests/null-byte | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/null-byte b/tests/null-byte index 9a768876..1d628065 100755 --- a/tests/null-byte +++ b/tests/null-byte @@ -51,9 +51,13 @@ for left in '' a '#' '\0'; do done done -(echo xxx && yes yyy | sed 100000q && printf '\0') >in || framework_failure_ +(echo xxx && yes yyy | sed 100000q && printf 'z\n\0') >in || framework_failure_ echo xxx >exp || framework_failure_ grep xxx in >out || fail=1 compare exp out || fail=1 +printf '%s\n' xxx 'Binary file in matches' > exp || framework_failure_ +grep -E 'xxx|z' in >out || fail=1 +compare exp out || fail=1 + Exit $fail |