diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-08-09 16:15:14 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-08-09 16:15:14 +0000 |
commit | 3fd15e197e21aa313ce56126ee814f0ebc884dee (patch) | |
tree | 38ac32cdea89bff09017eda0a1836e60f2c06749 /testsuite | |
parent | fb5902ca5cf802557eb1e3c56502a2f5e27242f4 (diff) | |
download | busybox-w32-3fd15e197e21aa313ce56126ee814f0ebc884dee.tar.gz busybox-w32-3fd15e197e21aa313ce56126ee814f0ebc884dee.tar.bz2 busybox-w32-3fd15e197e21aa313ce56126ee814f0ebc884dee.zip |
grep: option to use GNU regex matching instead of POSIX one.
This fixes problems with NULs in files being scanned, but
costs +800 bytes. The same can be done to sed (TODO).
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/grep.tests | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/testsuite/grep.tests b/testsuite/grep.tests index b2de2af54..8cee1b9ee 100755 --- a/testsuite/grep.tests +++ b/testsuite/grep.tests | |||
@@ -62,12 +62,8 @@ testing "grep -s nofile - (stdin and nonexisting file, match)" \ | |||
62 | "grep -s domatch nonexistent - ; echo \$?" \ | 62 | "grep -s domatch nonexistent - ; echo \$?" \ |
63 | "(standard input):domatch\n2\n" "" "nomatch\ndomatch\nend\n" | 63 | "(standard input):domatch\n2\n" "" "nomatch\ndomatch\nend\n" |
64 | 64 | ||
65 | # This doesn't match GNU behaviour (Binary file input matches) | 65 | testing "grep handles NUL in files" "grep -a foo input" "\0foo\n" "\0foo\n\n" "" |
66 | # acts like GNU grep -a | 66 | testing "grep handles NUL on stdin" "grep -a foo" "\0foo\n" "" "\0foo\n\n" |
67 | testing "grep handles binary files" "grep foo input" "foo\n" "\0foo\n\n" "" | ||
68 | # This doesn't match GNU behaviour (Binary file (standard input) matches) | ||
69 | # acts like GNU grep -a | ||
70 | testing "grep handles binary stdin" "grep foo" "foo\n" "" "\0foo\n\n" | ||
71 | 67 | ||
72 | testing "grep matches NUL" "grep . input > /dev/null 2>&1 ; echo \$?" \ | 68 | testing "grep matches NUL" "grep . input > /dev/null 2>&1 ; echo \$?" \ |
73 | "0\n" "\0\n" "" | 69 | "0\n" "\0\n" "" |