diff options
author | Jim Meyering <meyering@fb.com> | 2020-09-27 22:23:00 -0700 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2020-09-28 11:24:52 -0700 |
commit | 2f3ec21c25021355bd19ea3965b61607a0bdf83e (patch) | |
tree | 9bbbbce769587a92809ea5618bc9c50e83e7a33c /tests/filename-lineno.pl | |
parent | 111b8b59273d14afee2386611d5e10e22e507864 (diff) | |
download | grep-2f3ec21c25021355bd19ea3965b61607a0bdf83e.tar.gz |
tests: restore deleted -P tests
v3.4-almost-45-g8577dda deleted these two -P-using tests because a
grep built without PCRE support would fail those tests. This sets
an envvar with the equivalent of the result from the require_pcre_
function and restores the now-guarded tests. Tested by running this:
./configure --disable-perl-regexp && make check
* tests/Makefile.am (PCRE_WORKS): Set this envvar.
* tests/filename-lineno.pl: Restore invalid-re-P-paren and
invalid-re-P-star-paren, now each with a guard.
Diffstat (limited to 'tests/filename-lineno.pl')
-rwxr-xr-x | tests/filename-lineno.pl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/filename-lineno.pl b/tests/filename-lineno.pl index be927ef4..82b48cd8 100755 --- a/tests/filename-lineno.pl +++ b/tests/filename-lineno.pl @@ -97,6 +97,19 @@ my @Tests = ['invalid-re-G-star-paren', '-G "a.*\\)"', {EXIT=>2}, {ERR => "$prog: Unmatched ) or \\)\n"}, ], + ['invalid-re-P-paren', '-P ")"', {EXIT=>2}, + {ERR => $ENV{PCRE_WORKS} == 1 + ? "$prog: unmatched parentheses\n" + : "Perl matching not supported in a --disable-perl-regexp build\n" + }, + ], + ['invalid-re-P-star-paren', '-P "a.*)"', {EXIT=>2}, + {ERR => $ENV{PCRE_WORKS} == 1 + ? "$prog: unmatched parentheses\n" + : "Perl matching not supported in a --disable-perl-regexp build\n" + }, + ], + ); my $save_temps = $ENV{DEBUG}; |