X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/417e31d2c3d8fce4e3fcf07b04914a3773da8675..fa8195091647391bc39089e26dd9c6f9e1f4be24:/tests/local.at diff --git a/tests/local.at b/tests/local.at index 19f53cec..086ff757 100644 --- a/tests/local.at +++ b/tests/local.at @@ -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. ## ## ------------------------------- ##