Page MenuHomeFreeBSD

bsdgrep(1): Add more extensive testing for the different binary flags
ClosedPublic

Authored by kevans on May 5 2017, 11:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 20 2024, 8:15 PM
Unknown Object (File)
Sep 20 2024, 1:58 AM
Unknown Object (File)
Sep 14 2024, 1:28 PM
Unknown Object (File)
Sep 11 2024, 2:03 AM
Unknown Object (File)
Sep 5 2024, 1:28 AM
Unknown Object (File)
Aug 13 2024, 1:59 PM
Unknown Object (File)
Aug 10 2024, 3:37 AM
Unknown Object (File)
Jul 27 2024, 9:06 PM
Subscribers
None

Details

Summary

The 'binary' test currently in netbsd-tests/ does a basic check of the default
treatment for binary behavior, but not much further than that. Given some opportunity
for breakage recently that did not trigger any failures, add some tests to cover
the three different binary file behaviors (a, -I, -U) and their --binary-files=
equivalent values.

Test Plan

Run the tests with gnugrep and bsdgrep both to ensure proper behavior

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I did test this on the goof-up that was pointed out in D10607; it turns out that my mistake would not have broken binary file behavior anyways, because we don't bother setting f->binary at all with the -a flag, which is generally the scenario that would've ended up broken.

I'm still 50/50 on whether that's slightly terrifying or slightly warming, leaning towards 'warning' because detecting it as 'binary' is more overhead in locating a null byte.

This revision is now accepted and ready to land.May 11 2017, 4:07 PM
This revision was automatically updated to reflect the committed changes.