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)
Feb 13 2024, 4:36 PM
Unknown Object (File)
Dec 20 2023, 2:15 AM
Unknown Object (File)
Dec 10 2023, 7:22 PM
Unknown Object (File)
Apr 2 2023, 9:53 PM
Unknown Object (File)
Dec 26 2022, 5:33 AM
Unknown Object (File)
Nov 26 2022, 4:47 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.