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)
Wed, Jan 29, 10:19 AM
Unknown Object (File)
Mon, Jan 27, 9:28 PM
Unknown Object (File)
Fri, Jan 24, 10:07 PM
Unknown Object (File)
Dec 6 2024, 12:49 AM
Unknown Object (File)
Dec 4 2024, 10:46 AM
Unknown Object (File)
Dec 4 2024, 10:46 AM
Unknown Object (File)
Dec 4 2024, 10:45 AM
Unknown Object (File)
Dec 4 2024, 10:21 AM
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

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 9107
Build 9522: arc lint + arc unit

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.