]> git.saurik.com Git - bison.git/blobdiff - tests/local.at
Dub make_TOKEN as a public type interface.
[bison.git] / tests / local.at
index 19f53cec707c60d269732a6c05bb6f210f96c238..086ff757cde703e03046910493e70ee6a8363ce8 100644 (file)
 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.  ##
 ## ------------------------------- ##