HomeFreeBSD

bsdgrep: Revise tests based on recent fixes and future changes

Description

bsdgrep: Revise tests based on recent fixes and future changes

MFC r317297: Remove the expected failures for :context and :context2 with
bsdgrep(1)

They're no longer needed after recent fixes made to bsdgrep(1).

MFC r317299: Add more sanity tests for grep, egrep, and fgrep

The test suite currently lacks basic sanity checks to ensure that egrep,
fgrep, and grep are actually matching the right expression types, i.e.
passing the right flags to regcomp(3). Amend the test suite to make sure
that not only are the individual versions doing the right thing, but also
that we don't have some kind of frankenregex situation happening where egrep
is accepting a BRE or grep an ERE.

I've chosen to not expand the 'basic' test but to add the 'grep_sanity'
checks to their own test case since this is testing for more than just
'grep matches things', but actual expression types.

MFC r317694: bsdgrep: revise test case which will soon become a failure

Work in progress (D10315) is going to make egrep_empty_invalid an
actually invalid regex, to be consistent with the equivalent BRE "{"
behavior, when using regex(3).

Any non-0 exit value is acceptable, depending on how the installed grep
interprets the expression. GNU grep interprets it as non-matching, and
in the future BSD grep will interpret it is an error.

Approved by: emaste (mentor, blanket MFC)

Details

Provenance
kevansAuthored on
Parents
rS322560: bsdgrep: add -z/--null-data support and update NLS catalogs accordingly
Branches
Unknown
Tags
Unknown