summaryrefslogtreecommitdiff
path: root/tests/ere.awk
diff options
context:
space:
mode:
authorAlain Magloire <alainm@rcsm.ee.mcgill.ca>1998-11-22 06:47:44 +0000
committerAlain Magloire <alainm@rcsm.ee.mcgill.ca>1998-11-22 06:47:44 +0000
commitd9a3af9383f024574b5da34e07472322bf4e001d (patch)
tree57dea542d12c6b8d6c790beed696a19829fdeb1f /tests/ere.awk
parent695fbff68e97129065ec5060975cfd630c54248c (diff)
downloadgrep-d9a3af9383f024574b5da34e07472322bf4e001d.tar.gz
regression tests updated
Diffstat (limited to 'tests/ere.awk')
-rw-r--r--tests/ere.awk25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ere.awk b/tests/ere.awk
new file mode 100644
index 00000000..3f93a032
--- /dev/null
+++ b/tests/ere.awk
@@ -0,0 +1,25 @@
+BEGIN {
+ FS="@";
+ n = 0;
+ printf ("# Generated Spencer ERE Test\n");
+ printf ("failures=0\n");
+}
+
+$0 ~ /^#/ { next; }
+
+NF == 3 {
+ printf ("echo '%s' | ${GREP} -E -e '%s' > /dev/null 2>&1\n",$3, $2);
+ printf ("if test $? -ne %s ; then\n", $1);
+ printf ("\techo Spencer ere test \\#%d failed\n", ++n);
+ printf ("\tfailures=1\n");
+ printf ("fi\n");
+}
+
+NF == 4 {
+ printf ("echo '%s'|${GREP} -E -e '%s' > /dev/null 2>&1\n",$3, $2);
+ printf ("if test $? -ne %s ; then\n", $1);
+ printf ("\techo Expected non conformance \\#%d ... continuing\n", ++n);
+ printf ("fi\n");
+}
+
+END { printf ("exit $failures\n"); }