mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
Fix portability issue in the test suite.
* tests/local.at (AT_MATCHES_CHECK): New. Based on Perl instead of Sed. Sed has too many portability pitfalls, not ever Sed is GNU Sed. * tests/actions.at (Fix user actions without a trailing semicolon): Use it.
This commit is contained in:
@@ -20,6 +20,22 @@
|
||||
m4_version_prereq([2.58])
|
||||
|
||||
|
||||
## ------------- ##
|
||||
## Basic tests. ##
|
||||
## ------------- ##
|
||||
|
||||
# AT_MATCHES_CHECK(FILE, PERL-REGEXP, COUNT)
|
||||
# ------------------------------------------
|
||||
# Expect COUNT matches of the PERL-REGEXP in FILE. The file is
|
||||
# taken in "slurp" mode, i.e., one can match end-of-lines.
|
||||
m4_define([AT_MATCHES_CHECK],
|
||||
[AT_CHECK([perl -0777 -ne '
|
||||
my $count = 0;
|
||||
s{$2}{ ++$count; "" }gem;
|
||||
printf "$count\n";' $1], [0], [$3
|
||||
])])
|
||||
|
||||
|
||||
## ------------------------------- ##
|
||||
## Macros decoding Bison options. ##
|
||||
## ------------------------------- ##
|
||||
|
||||
Reference in New Issue
Block a user