diff options
Diffstat (limited to 'test')
100 files changed, 4052 insertions, 168 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 2508ef0f..aa3b6645 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,7 +1,209 @@ -Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com> +Sun Jun 3 13:04:44 2001 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.0: Release tar file made. And there was + rejoicing. + +Sun May 6 13:30:20 2001 Arnold Robbins <arnold@skeeve.com> + + * inftest.awk: Changed test to use < so that it will + work for MSC and DJGPP combination, per Scott Deifik. + +Tue Mar 20 11:09:51 2001 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (funsemnl): new test case. + * funsemnl.awk, funsemnl.ok: new files. + +Wed Mar 7 11:31:41 2001 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (leadnl): new test case. + * leadnl.awk, leadnl.in, leadnl.ok: new files. + +Tue Feb 6 18:08:15 2001 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (rebt8b1, rebt8b2): new test case. + * rebt8b1.awk, rebt8b1.ok: new files. + * rebt8b2.awk, rebt8b2.ok: new files. + +Sun Dec 3 15:36:41 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (gnuops2): New test case. + * gnuops2.awk, gnuops2.ok: New files, based on bug report from + Servatius.Brandt@fujitsu-siemens.com. + +Mon Nov 27 15:52:46 2000 Arnold Robbins <arnold@skeeve.com> + + * regx8bit.awk, regx8bit.ok: Updated to what should + work on all systems. + +Wed Nov 22 13:27:59 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (poundbang): Added some smarts for /tmp mounted + noexec. Hopefully it'll even work. + +Tue Nov 14 17:45:02 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am: Added - to all cmp calls for consistency. + +Sun Nov 12 17:50:18 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (addcomma): new test case. + * addcomma.awk, addcomma.in, addcomma.ok: new files. + +Tue Nov 7 16:03:06 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (regx8bit, psx96sub): new test cases. + * regx8bit.awk, regx8bit.ok, psx96sub.awk, psx96sub.ok: new files. + +Sun Oct 22 12:09:43 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (shadow): new test case. + * shadow.awk, shadow.ok: new files. + +Tue Oct 17 10:51:09 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (arynasty): new test case. + * arynasty.awk, arynasty.ok: new files. + +Mon Oct 2 10:17:13 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (clsflnam): Add redirect of stderr. + * clsflnam.awk, clsflnam.ok: modified to reflect changed + semantics of close() for a non-open file. See ../ChangeLog. + +Sun Sep 24 16:46:29 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (nasty2): new test case. + * nasty2.awk, nasty2.ok: new files. + +Wed Sep 13 11:09:49 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (check): Added calls to new targets that + print messages. + (clos1way, basic-msg-start, basic-msg-end, unix-msg-start, + unix-msg-end, extend-msg-start, extend-msg-end): new targets. + * clos1way.awk, clos1way.ok: new files. + +Tue Sep 12 16:29:54 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (leaddig): new test case. + * leaddig.awk, leaddig.ok: new files. + +Wed Sep 6 14:09:15 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (strtod): new test case. + * strtod.awk, strtod.in, strtod.ok: new files. + +Mon Sep 4 09:33:28 2000 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.in (octsub): new test case. + * octsub.awk, octsub.ok: new files. + +Sun Aug 13 12:37:16 2000 Arnold Robbins <arnold@skeeve.com> + + * Makefile.am (sort1, diffout): new test cases. + * sort1.awk, sort1.ok: new files. - * Release 3.0.6: Release tar file made. +2000-02-15 Arnold Robbins <arnold@skeeve.com> + * MOVED TO AUTOMAKE AND GETTEXT. + Just about every file touched. Work done by Arno Peters. + +Wed May 19 15:41:41 1999 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (datanonl,regeq,redfilnm): new test cases. + * datanonl.awk, datanonl.in, datanonl.ok: new files. + * regeq.awk, regeq.in, regeq.ok: new files. + * redfilnm.awk, redfilnm.in, redfilnm.ok: new files. + +Mon May 10 17:11:30 1999 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (rsnul1nl): new test case. + * rsnul1nl.awk, rsnul1nl.in, rsnul1nl.ok: new files. + +Sun Apr 25 13:02:35 1999 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (inetechu,inetecht,inetdayu,inetdayt,inet): new + tests, courtesy of Juergen Khars. + (paramtyp): new test for bug from Juergen. + * paramtyp.awk, paramtyp.in: new files. + +Sun Oct 25 23:11:46 1998 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (ofmtbig,procinfs): new test cases. + * procinfs.awk, procinfs.ok: new files. + * ofmtbig.awk, ofmtbig.in, ofmtbig.ok: new files. + +Tue Oct 20 22:07:10 1998 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (lint): new test case. + * lint.awk, lint.ok: new files. + * badargs.ok: updated output corresponding to change made to + main.c (see main ChangeLog). + +Tue May 26 20:39:07 1998 Arnold D. Robbins <arnold@gnu.org> + + * pipeio2.awk: change "\'" to "'" to avoid new warning. + +Mon Mar 23 21:53:36 1998 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (fnasgnm): new test case. + * fnasgnm.awk, fnasgnm.in, fnasgnm.ok: new files. + +Fri Mar 20 11:01:38 1998 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (fnaryscl): new test case. + * fnaryscl.awk, fnaryscl.ok: new files. + +Mon Mar 16 15:23:22 1998 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (splitdef): new test case. + * splitdef.awk, splitdef.ok: new files. + +Fri Sep 26 01:10:14 1997 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (parseme): new test case. + * parseme.awk, parseme.ok: new files. + +Sun Sep 14 23:25:10 1997 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (ofmts): new test case. + * ofmts.awk, ofmts.in, ofmts.ok: new files. + +Sun Aug 17 07:17:35 1997 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (fsfwfs): new test case. + * fsfwfs.awk, fsfwfs.in, fsfwfs.ok: new files. + +Sun Jul 27 23:08:53 1997 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (hsprint): new test case. + * hsprint.awk, hsprint.ok, printfloat.awk: new files. + +Thu Jul 17 20:07:31 1997 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (ofmt): new test case. + * ofmt.awk, ofmt.in, ofmt.ok: new files. + +Sun Jun 22 16:17:35 1997 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (nlinstr): new test case. + * nlinstr.awk, nlinstr.in, nlinstr.ok: new files. + +Wed Jun 4 13:18:21 1997 Arnold D. Robbins <arnold@gnu.org> + + * pid.sh: send errors to /dev/null to toss warning about + using PROCINFO["pid"] etc. This test explicitly tests + the special files. It'll need changing in 3.2. + +Thu Apr 24 23:24:59 1997 Arnold D. Robbins <arnold@gnu.org> + + * Makefile.in (messages): remove special case if /dev/fd exists. + Finally. + +Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.0.6: Release tar file made. + Thu Aug 3 17:51:56 2000 Arnold D. Robbins <arnold@skeeve.com> * Makefile.in (nlstrina): new test case. @@ -86,7 +288,7 @@ Thu Jul 29 19:25:02 1999 Arnold D. Robbins <arnold@skeeve.com> * fnamedat.awk, fnamedat.in, fnamedat.ok: new files. Wed Jun 30 16:14:36 1999 Arnold D. Robbins <arnold@gnu.org> - + * Release 3.0.4: Release tar file made. This time for sure. Tue May 25 16:37:50 1999 Arnold D. Robbins <arnold@gnu.org> diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 00000000..e1dbdfd8 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,1036 @@ +# +# test/Makefile.am --- automake input file for gawk +# +# Copyright (C) 1988-2001 the Free Software Foundation, Inc. +# +# This file is part of GAWK, the GNU implementation of the +# AWK Programming Language. +# +# GAWK is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# GAWK is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# + +## process this file with automake to produce Makefile.in + +EXTRA_DIST = \ + reg \ + lib \ + README \ + addcomma.awk \ + addcomma.in \ + addcomma.ok \ + anchgsub.awk \ + anchgsub.in \ + anchgsub.ok \ + argarray.awk \ + argarray.in \ + argarray.ok \ + argtest.awk \ + argtest.ok \ + arrayparm.awk \ + arrayparm.ok \ + arrayref.awk \ + arrayref.ok \ + arynasty.awk \ + arynasty.ok \ + arynocls.awk \ + arynocls.in \ + arynocls.ok \ + arysubnm.awk \ + arysubnm.ok \ + asgext.awk \ + asgext.in \ + asgext.ok \ + awkpath.ok \ + back89.in \ + back89.ok \ + backgsub.awk \ + backgsub.in \ + backgsub.ok \ + badargs.ok \ + childin.ok \ + clobber.awk \ + clobber.ok \ + clos1way.awk \ + clos1way.ok \ + clsflnam.awk \ + clsflnam.in \ + clsflnam.ok \ + compare.awk \ + compare.in \ + compare.ok \ + convfmt.awk \ + convfmt.ok \ + datanonl.awk \ + datanonl.in \ + datanonl.ok \ + defref.awk \ + defref.ok \ + delarprm.awk \ + delarprm.ok \ + dynlj.awk \ + dynlj.ok \ + eofsplit.awk \ + eofsplit.ok \ + fflush.ok \ + fflush.sh \ + fieldwdth.ok \ + fldchg.awk \ + fldchg.in \ + fldchg.ok \ + fldchgnf.awk \ + fldchgnf.in \ + fldchgnf.ok \ + fnamedat.awk \ + fnamedat.in \ + fnamedat.ok \ + fnarray.awk \ + fnarray.ok \ + fnarydel.awk \ + fnarydel.ok \ + fnaryscl.awk \ + fnaryscl.ok \ + fnasgnm.awk \ + fnasgnm.in \ + fnasgnm.ok \ + fnparydl.awk \ + fnparydl.ok \ + fsbs.in \ + fsbs.ok \ + fsfwfs.awk \ + fsfwfs.in \ + fsfwfs.ok \ + fsrs.awk \ + fsrs.in \ + fsrs.ok \ + fstabplus.awk \ + fstabplus.ok \ + funsemnl.awk \ + funsemnl.ok \ + funsmnam.awk \ + funsmnam.ok \ + funstack.awk \ + funstack.in \ + funstack.ok \ + gensub.awk \ + gensub.in \ + gensub.ok \ + getline.awk \ + getline.ok \ + getlnbuf.awk \ + getlnbuf.in \ + getlnbuf.ok \ + getlnhd.awk \ + getlnhd.ok \ + getnr2tb.awk \ + getnr2tb.in \ + getnr2tb.ok \ + getnr2tm.awk \ + getnr2tm.in \ + getnr2tm.ok \ + gnuops2.awk \ + gnuops2.ok \ + gnureops.awk \ + gnureops.ok \ + gsubasgn.awk \ + gsubasgn.ok \ + gsubtest.awk \ + gsubtest.ok \ + gtlnbufv.awk \ + hsprint.awk \ + hsprint.ok \ + igncdym.awk \ + igncdym.in \ + igncdym.ok \ + igncfs.awk \ + igncfs.in \ + igncfs.ok \ + ignrcase.ok \ + inftest.awk \ + inftest.ok \ + intest.awk \ + intest.ok \ + intprec.awk \ + intprec.ok \ + leaddig.awk \ + leaddig.ok \ + leadnl.awk \ + leadnl.in \ + leadnl.ok \ + lint.awk \ + lint.ok \ + litoct.awk \ + litoct.ok \ + longwrds.awk \ + longwrds.ok \ + manpage \ + manyfiles.awk \ + math.awk \ + math.ok \ + messages.awk \ + mmap8k.in \ + nasty.awk \ + nasty.ok \ + nasty2.awk \ + nasty2.ok \ + negexp.ok \ + nfldstr.ok \ + nfset.awk \ + nfset.in \ + nfset.ok \ + nlfldsep.awk \ + nlfldsep.in \ + nlfldsep.ok \ + nlinstr.awk \ + nlinstr.in \ + nlinstr.ok \ + nlstrina.awk \ + nlstrina.ok \ + noeffect.awk \ + noeffect.ok \ + nofmtch.awk \ + nofmtch.ok \ + nondec.awk \ + nondec.ok \ + nonl.awk \ + nonl.ok \ + noparms.awk \ + noparms.ok \ + nors.in \ + nors.ok \ + numindex.awk \ + numindex.in \ + numindex.ok \ + numsubstr.awk \ + numsubstr.in \ + numsubstr.ok \ + octsub.awk \ + octsub.ok \ + ofmt.awk \ + ofmt.in \ + ofmt.ok \ + ofmtbig.awk \ + ofmtbig.in \ + ofmtbig.ok \ + ofmts.awk \ + ofmts.in \ + ofmts.ok \ + opasnidx.awk \ + opasnidx.ok \ + opasnslf.awk \ + opasnslf.ok \ + out1.ok \ + out2.ok \ + out3.ok \ + paramdup.awk \ + paramdup.ok \ + paramtyp.awk \ + paramtyp.ok \ + parseme.awk \ + parseme.ok \ + pcntplus.awk \ + pcntplus.ok \ + pid.awk \ + pid.ok \ + pid.sh \ + pipeio1.awk \ + pipeio1.ok \ + pipeio2.awk \ + pipeio2.in \ + pipeio2.ok \ + posix.awk \ + posix.ok \ + poundbang.awk \ + poundbang.ok \ + prdupval.awk \ + prdupval.in \ + prdupval.ok \ + printf1.awk \ + printf1.ok \ + printfloat.awk \ + prmarscl.awk \ + prmarscl.ok \ + prmreuse.awk \ + prmreuse.ok \ + procinfs.awk \ + procinfs.ok \ + prt1eval.awk \ + prt1eval.ok \ + prtoeval.awk \ + prtoeval.ok \ + psx96sub.awk \ + psx96sub.ok \ + rand.awk \ + rand.ok \ + rebt8b1.awk \ + rebt8b1.ok \ + rebt8b2.awk \ + rebt8b2.ok \ + redfilnm.awk \ + redfilnm.in \ + redfilnm.ok \ + regeq.awk \ + regeq.in \ + regeq.ok \ + regtest.sh \ + regx8bit.awk \ + regx8bit.ok \ + reindops.awk \ + reindops.in \ + reindops.ok \ + reint.awk \ + reint.in \ + reint.ok \ + reparse.awk \ + reparse.in \ + reparse.ok \ + resplit.ok \ + rs.in \ + rs.ok \ + rsnul1nl.awk \ + rsnul1nl.in \ + rsnul1nl.ok \ + rswhite.awk \ + rswhite.in \ + rswhite.ok \ + sclforin.awk \ + sclforin.ok \ + sclifin.awk \ + sclifin.ok \ + shadow.awk \ + shadow.ok \ + sort1.awk \ + sort1.ok \ + splitargv.awk \ + splitargv.in \ + splitargv.ok \ + splitdef.awk \ + splitdef.ok \ + splitvar.awk \ + splitvar.in \ + splitvar.ok \ + splitwht.awk \ + splitwht.ok \ + sprintfc.awk \ + sprintfc.in \ + sprintfc.ok \ + strtod.awk \ + strtod.in \ + strtod.ok \ + strftime.awk \ + strftlng.awk \ + strftlng.ok \ + subslash.awk \ + subslash.ok \ + substr.awk \ + substr.ok \ + swaplns.awk \ + swaplns.in \ + swaplns.ok \ + tradanch.awk \ + tradanch.in \ + tradanch.ok \ + tweakfld.awk \ + tweakfld.in \ + tweakfld.ok \ + zeroflag.awk \ + zeroflag.ok + +CMP = cmp +AWK = ../gawk + +# message stuff is to make it a little easier to follow +check: msg \ + basic-msg-start basic basic-msg-end \ + unix-msg-start unix-tests unix-msg-end \ + extend-msg-start gawk-extensions extend-msg-end + +# try to keep these sorted +basic: addcomma anchgsub argarray arrayparm arrayref arynasty arynocls \ + arysubnm asgext awkpath back89 backgsub childin clobber clsflnam \ + compare convfmt datanonl defref delarprm dynlj eofsplit fldchg \ + fldchgnf fnamedat fnarray fnarydel fnaryscl fnasgnm fnparydl \ + fsbs fsrs fstabplus funsemnl funsmnam funstack getline getlnbuf getnr2tb \ + getnr2tm gsubasgn gsubtest hsprint intest intprec leaddig leadnl litoct \ + longwrds math messages mmap8k nasty nasty2 negexp nfldstr nfset \ + nlfldsep nlinstr nlstrina noeffect nofmtch nonl noparms nors \ + numindex numsubstr octsub ofmt ofmtbig ofmts opasnidx opasnslf \ + paramdup paramtyp parseme pcntplus prdupval printf1 prmarscl \ + prmreuse prt1eval prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm \ + regeq reindops reparse resplit rs rsnul1nl rswhite sclforin \ + sclifin splitargv splitdef splitvar splitwht sprintfc strtod \ + subslash substr swaplns tradanch tweakfld zeroflag + +unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundbang strftlng + +gawk-extensions: argtest badargs clos1way fieldwdth fsfwfs gensub \ + gnuops2 gnureops igncdym igncfs ignrcase lint manyfiles nondec \ + posix procinfs regx8bit reint shadow sort1 strftime + +extra: regtest inftest inet + +inet: inetmesg inetechu inetecht inetdayu inetdayt + +msg:: + @echo 'Any output from "cmp" is bad news, although some differences' + @echo 'in floating point values are probably benign -- in particular,' + @echo 'some systems may omit a leading zero and the floating point' + @echo 'precision may lead to slightly different output in a few cases.' + +basic-msg-start: + @echo "======== Starting basic tests ========" + +basic-msg-end: + @echo "======== Done with basic tests ========" + +unix-msg-start: + @echo "======== Starting Unix tests ========" + +unix-msg-end: + @echo "======== Done with Unix tests ========" + +extend-msg-start: + @echo "======== Starting gawk extension tests ========" + +extend-msg-end: + @echo "======== Done with gawk extension tests ========" + + +# This test is a PITA because increasingly, /tmp is getting +# mounted noexec. So, we'll test it. Sigh. +poundbang:: + @cp $(AWK) /tmp/gawk + @if /tmp/gawk 'BEGIN { print "OK" }' | grep OK > /dev/null ; \ + then \ + $(srcdir)/poundbang.awk $(srcdir)/poundbang.awk >_`basename $@` ; \ + $(CMP) $(srcdir)/poundbang.ok _`basename $@` && rm -f _`basename $@` && echo poundbang is ok ; \ + else \ + echo "*** /tmp is apparently mounted noexec, skipping poundbang test." ; \ + fi + @rm -f /tmp/gawk + +swaplns:: + @$(AWK) -f $(srcdir)/swaplns.awk $(srcdir)/swaplns.in >_$@ + -$(CMP) $(srcdir)/swaplns.ok _$@ && rm -f _$@ + +messages:: + @$(AWK) -f $(srcdir)/messages.awk >out2 2>out3 + -$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3 + +argarray:: + @case $(srcdir) in \ + .) : ;; \ + *) cp $(srcdir)/argarray.in . ;; \ + esac + @TEST=test echo just a test | $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@ + -$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@ + +fstabplus:: + @echo '1 2' | $(AWK) -f $(srcdir)/fstabplus.awk >_$@ + -$(CMP) $(srcdir)/fstabplus.ok _$@ && rm -f _$@ + +fsrs:: + @$(AWK) -f $(srcdir)/fsrs.awk $(srcdir)/fsrs.in >_$@ + -$(CMP) $(srcdir)/fsrs.ok _$@ && rm -f _$@ + +igncfs:: + @$(AWK) -f $(srcdir)/igncfs.awk $(srcdir)/igncfs.in >_$@ + -$(CMP) $(srcdir)/igncfs.ok _$@ && rm -f _$@ + +longwrds:: + @$(AWK) -f $(srcdir)/longwrds.awk $(srcdir)/manpage | (LC_ALL=C sort) >_$@ + -$(CMP) $(srcdir)/longwrds.ok _$@ && rm -f _$@ + +fieldwdth:: + @echo '123456789' | $(AWK) -v FIELDWIDTHS="2 3 4" '{ print $$2}' >_$@ + -$(CMP) $(srcdir)/fieldwdth.ok _$@ && rm -f _$@ + +ignrcase:: + @echo xYz | $(AWK) -v IGNORECASE=1 '{ sub(/y/, ""); print}' >_$@ + -$(CMP) $(srcdir)/ignrcase.ok _$@ && rm -f _$@ + +regtest:: + @echo 'Some of the output from regtest is very system specific, do not' + @echo 'be distressed if your output differs from that distributed.' + @echo 'Manual inspection is called for.' + AWK=`pwd`/$(AWK) $(srcdir)/regtest.awk + +posix:: + @echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@ + -$(CMP) $(srcdir)/posix.ok _$@ && rm -f _$@ + +manyfiles:: + @rm -rf junk + @mkdir junk + @$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@ + @$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@ + @echo "This number better be 1 ->" | tr -d '\012' + @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l + @rm -rf junk _$@ + +compare:: + @$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@ + -$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@ + +arrayref:: + @$(AWK) -f $(srcdir)/arrayref.awk >_$@ + -$(CMP) $(srcdir)/arrayref.ok _$@ && rm -f _$@ + +rs:: + @$(AWK) -v RS="" '{ print $$1, $$2}' $(srcdir)/rs.in >_$@ + -$(CMP) $(srcdir)/rs.ok _$@ && rm -f _$@ + +fsbs:: + @$(AWK) -v FS='\' '{ print $$1, $$2 }' $(srcdir)/fsbs.in >_$@ + -$(CMP) $(srcdir)/fsbs.ok _$@ && rm -f _$@ + +inftest:: + @echo This test is very machine specific... + @$(AWK) -f $(srcdir)/inftest.awk >_$@ + -$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ + +getline:: + @$(AWK) -f $(srcdir)/getline.awk $(srcdir)/getline.awk $(srcdir)/getline.awk >_$@ + -$(CMP) $(srcdir)/getline.ok _$@ && rm -f _$@ + +rand:: + @$(AWK) -f $(srcdir)/rand.awk >_$@ + -$(CMP) $(srcdir)/rand.ok _$@ && rm -f _$@ + +negexp:: + @$(AWK) 'BEGIN { a = -2; print 10^a }' >_$@ + -$(CMP) $(srcdir)/negexp.ok _$@ && rm -f _$@ + +asgext:: + @$(AWK) -f $(srcdir)/asgext.awk $(srcdir)/asgext.in >_$@ + -$(CMP) $(srcdir)/asgext.ok _$@ && rm -f _$@ + +anchgsub:: + @$(AWK) -f $(srcdir)/anchgsub.awk $(srcdir)/anchgsub.in >_$@ + -$(CMP) $(srcdir)/anchgsub.ok _$@ && rm -f _$@ + +splitargv:: + @$(AWK) -f $(srcdir)/splitargv.awk $(srcdir)/splitargv.in >_$@ + -$(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@ + +awkpath:: + @AWKPATH="$(srcdir):$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@ + -$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@ + +nfset:: + @$(AWK) -f $(srcdir)/nfset.awk $(srcdir)/nfset.in >_$@ + -$(CMP) $(srcdir)/nfset.ok _$@ && rm -f _$@ + +reparse:: + @$(AWK) -f $(srcdir)/reparse.awk $(srcdir)/reparse.in >_$@ + -$(CMP) $(srcdir)/reparse.ok _$@ && rm -f _$@ + +argtest:: + @$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@ + -$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@ + +badargs:: + @-$(AWK) -f 2>&1 | grep -v patchlevel >_$@ + -$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@ + +convfmt:: + @$(AWK) -f $(srcdir)/convfmt.awk >_$@ + -$(CMP) $(srcdir)/convfmt.ok _$@ && rm -f _$@ + +arrayparm:: + @-AWKPATH=$(srcdir) $(AWK) -f arrayparm.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/arrayparm.ok _$@ && rm -f _$@ + +paramdup:: + @-AWKPATH=$(srcdir) $(AWK) -f paramdup.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/paramdup.ok _$@ && rm -f _$@ + +nonl:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1 + -$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@ + +defref:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f defref.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/defref.ok _$@ && rm -f _$@ + +nofmtch:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f nofmtch.awk >_$@ 2>&1 + -$(CMP) $(srcdir)/nofmtch.ok _$@ && rm -f _$@ + +strftime:: + : this test could fail on slow machines or on a second boundary, + : so if it does, double check the actual results + @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ + date | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk + -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 + +litoct:: + @echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@ + -$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@ + +gensub:: + @$(AWK) -f $(srcdir)/gensub.awk $(srcdir)/gensub.in >_$@ + -$(CMP) $(srcdir)/gensub.ok _$@ && rm -f _$@ + +resplit:: + @echo a:b:c d:e:f | $(AWK) '{ FS = ":"; $$0 = $$0; print $$2 }' > _$@ + -$(CMP) $(srcdir)/resplit.ok _$@ && rm -f _$@ + +rswhite:: + @$(AWK) -f $(srcdir)/rswhite.awk $(srcdir)/rswhite.in > _$@ + -$(CMP) $(srcdir)/rswhite.ok _$@ && rm -f _$@ + +prmarscl:: + @-AWKPATH=$(srcdir) $(AWK) -f prmarscl.awk > _$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/prmarscl.ok _$@ && rm -f _$@ + +sclforin:: + @-AWKPATH=$(srcdir) $(AWK) -f sclforin.awk > _$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/sclforin.ok _$@ && rm -f _$@ + +sclifin:: + @-AWKPATH=$(srcdir) $(AWK) -f sclifin.awk > _$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/sclifin.ok _$@ && rm -f _$@ + +intprec:: + @-$(AWK) -f $(srcdir)/intprec.awk > _$@ 2>&1 + -$(CMP) $(srcdir)/intprec.ok _$@ && rm -f _$@ + +childin:: + @echo hi | $(AWK) 'BEGIN { "cat" | getline; print; close("cat") }' > _$@ + -$(CMP) $(srcdir)/childin.ok _$@ && rm -f _$@ + +noeffect:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f noeffect.awk > _$@ 2>&1 + -$(CMP) $(srcdir)/noeffect.ok _$@ && rm -f _$@ + +numsubstr:: + @-AWKPATH=$(srcdir) $(AWK) -f numsubstr.awk $(srcdir)/numsubstr.in >_$@ + -$(CMP) $(srcdir)/numsubstr.ok _$@ && rm -f _$@ + +gnureops:: + @$(AWK) -f $(srcdir)/gnureops.awk >_$@ + -$(CMP) $(srcdir)/gnureops.ok _$@ && rm -f _$@ + +pcntplus:: + @$(AWK) -f $(srcdir)/pcntplus.awk >_$@ + -$(CMP) $(srcdir)/pcntplus.ok _$@ && rm -f _$@ + +prmreuse:: + @$(AWK) -f $(srcdir)/prmreuse.awk >_$@ + -$(CMP) $(srcdir)/prmreuse.ok _$@ && rm -f _$@ + +math:: + @$(AWK) -f $(srcdir)/math.awk >_$@ + -$(CMP) $(srcdir)/math.ok _$@ && rm -f _$@ + +fflush:: + @$(srcdir)/fflush.sh >_$@ + -$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@ + +fldchg:: + @$(AWK) -f $(srcdir)/fldchg.awk $(srcdir)/fldchg.in >_$@ + -$(CMP) $(srcdir)/fldchg.ok _$@ && rm -f _$@ + +fldchgnf:: + @$(AWK) -f $(srcdir)/fldchgnf.awk $(srcdir)/fldchgnf.in >_$@ + -$(CMP) $(srcdir)/fldchgnf.ok _$@ && rm -f _$@ + +reindops:: + @$(AWK) -f $(srcdir)/reindops.awk $(srcdir)/reindops.in >_$@ + -$(CMP) $(srcdir)/reindops.ok _$@ && rm -f _$@ + +sprintfc:: + @$(AWK) -f $(srcdir)/sprintfc.awk $(srcdir)/sprintfc.in >_$@ + -$(CMP) $(srcdir)/sprintfc.ok _$@ && rm -f _$@ + +getlnhd:: + @$(AWK) -f $(srcdir)/getlnhd.awk >_$@ + -$(CMP) $(srcdir)/getlnhd.ok _$@ && rm -f _$@ + +backgsub:: + @$(AWK) -f $(srcdir)/backgsub.awk $(srcdir)/backgsub.in >_$@ + -$(CMP) $(srcdir)/backgsub.ok _$@ && rm -f _$@ + +tweakfld:: + @$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@ + @rm -f errors.cleanup + -$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@ + +clsflnam:: + @$(AWK) -f $(srcdir)/clsflnam.awk $(srcdir)/clsflnam.in >_$@ 2>&1 + -$(CMP) $(srcdir)/clsflnam.ok _$@ && rm -f _$@ + +mmap8k:: + @$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@ + -$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@ + +fnarray:: + @-AWKPATH=$(srcdir) $(AWK) -f fnarray.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/fnarray.ok _$@ && rm -f _$@ + +dynlj:: + @$(AWK) -f $(srcdir)/dynlj.awk >_$@ + -$(CMP) $(srcdir)/dynlj.ok _$@ && rm -f _$@ + +substr:: + @$(AWK) -f $(srcdir)/substr.awk >_$@ + -$(CMP) $(srcdir)/substr.ok _$@ && rm -f _$@ + +eofsplit:: + @$(AWK) -f $(srcdir)/eofsplit.awk >_$@ + -$(CMP) $(srcdir)/eofsplit.ok _$@ && rm -f _$@ + +prt1eval:: + @$(AWK) -f $(srcdir)/prt1eval.awk >_$@ + -$(CMP) $(srcdir)/prt1eval.ok _$@ && rm -f _$@ + +gsubasgn:: + @-AWKPATH=$(srcdir) $(AWK) -f gsubasgn.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/gsubasgn.ok _$@ && rm -f _$@ + +prtoeval:: + @$(AWK) -f $(srcdir)/prtoeval.awk >_$@ + -$(CMP) $(srcdir)/prtoeval.ok _$@ && rm -f _$@ + +gsubtest:: + @$(AWK) -f $(srcdir)/gsubtest.awk >_$@ + -$(CMP) $(srcdir)/gsubtest.ok _$@ && rm -f _$@ + +splitwht:: + @$(AWK) -f $(srcdir)/splitwht.awk >_$@ + -$(CMP) $(srcdir)/splitwht.ok _$@ && rm -f _$@ + +back89:: + @$(AWK) '/a\8b/' $(srcdir)/back89.in >_$@ + -$(CMP) $(srcdir)/back89.ok _$@ && rm -f _$@ + +tradanch:: + @$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@ + -$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@ + +nlfldsep:: + @$(AWK) -f $(srcdir)/nlfldsep.awk $(srcdir)/nlfldsep.in > _$@ + -$(CMP) $(srcdir)/nlfldsep.ok _$@ && rm -f _$@ + +splitvar:: + @$(AWK) -f $(srcdir)/splitvar.awk $(srcdir)/splitvar.in >_$@ + -$(CMP) $(srcdir)/splitvar.ok _$@ && rm -f _$@ + +intest:: + @$(AWK) -f $(srcdir)/intest.awk >_$@ + -$(CMP) $(srcdir)/intest.ok _$@ && rm -f _$@ + +# AIX /bin/sh exec's the last command in a list, therefore issue a ":" +# command so that pid.sh is fork'ed as a child before being exec'ed. +pid:: + @AWKPATH=$(srcdir) AWK=$(AWK) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; : + -$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in + +strftlng:: + @TZ=UTC; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ + @if $(CMP) -s $(srcdir)/strftlng.ok _$@ ; then : ; else \ + TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \ + fi + -$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@ + +nfldstr:: + @echo | $(AWK) '$$1 == 0 { print "bug" }' > _$@ + -$(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@ + +nors:: + @echo A B C D E | tr -d '\12' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ + -$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ + +fnarydel:: + @$(AWK) -f $(srcdir)/fnarydel.awk >_$@ + -$(CMP) $(srcdir)/fnarydel.ok _$@ && rm -f _$@ + +reint:: + @$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@ + -$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@ + +noparms:: + @-AWKPATH=$(srcdir) $(AWK) -f noparms.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/noparms.ok _$@ && rm -f _$@ + +pipeio1:: + @$(AWK) -f $(srcdir)/pipeio1.awk >_$@ + @rm -f test1 test2 + -$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@ + +pipeio2:: + @$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@ + -$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@ + +funstack:: + @$(AWK) -f $(srcdir)/funstack.awk $(srcdir)/funstack.in >_$@ + -$(CMP) $(srcdir)/funstack.ok _$@ && rm -f _$@ + +clobber:: + @$(AWK) -f $(srcdir)/clobber.awk >_$@ + -$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@ + @rm -f seq + +delarprm:: + @$(AWK) -f $(srcdir)/delarprm.awk >_$@ + -$(CMP) $(srcdir)/delarprm.ok _$@ && rm -f _$@ + +prdupval:: + @$(AWK) -f $(srcdir)/prdupval.awk $(srcdir)/prdupval.in >_$@ + -$(CMP) $(srcdir)/prdupval.ok _$@ && rm -f _$@ + +nondec:: + @if grep BITOP ../config.h | grep define > /dev/null; \ + then \ + $(AWK) -f $(srcdir)/nondec.awk >_$@; \ + else \ + cp $(srcdir)/nondec.ok _$@; \ + fi + -$(CMP) $(srcdir)/nondec.ok _$@ && rm -f _$@ + +nasty:: + @$(AWK) -f $(srcdir)/nasty.awk >_$@ + -$(CMP) $(srcdir)/nasty.ok _$@ && rm -f _$@ + +nasty2:: + @$(AWK) -f $(srcdir)/nasty2.awk >_$@ + -$(CMP) $(srcdir)/nasty2.ok _$@ && rm -f _$@ + +zeroflag:: + @$(AWK) -f $(srcdir)/zeroflag.awk >_$@ + -$(CMP) $(srcdir)/zeroflag.ok _$@ && rm -f _$@ + +getnr2tm:: + @$(AWK) -f $(srcdir)/getnr2tm.awk $(srcdir)/getnr2tm.in >_$@ + -$(CMP) $(srcdir)/getnr2tm.ok _$@ && rm -f _$@ + +getnr2tb:: + @$(AWK) -f $(srcdir)/getnr2tb.awk $(srcdir)/getnr2tb.in >_$@ + -$(CMP) $(srcdir)/getnr2tb.ok _$@ && rm -f _$@ + +printf1:: + @$(AWK) -f $(srcdir)/printf1.awk >_$@ + -$(CMP) $(srcdir)/printf1.ok _$@ && rm -f _$@ + +funsmnam:: + @-AWKPATH=$(srcdir) $(AWK) -f funsmnam.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/funsmnam.ok _$@ && rm -f _$@ + +fnamedat:: + @-AWKPATH=$(srcdir) $(AWK) -f fnamedat.awk < $(srcdir)/fnamedat.in >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/fnamedat.ok _$@ && rm -f _$@ + +numindex:: + @-AWKPATH=$(srcdir) $(AWK) -f numindex.awk < $(srcdir)/numindex.in >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/numindex.ok _$@ && rm -f _$@ + +subslash:: + @-AWKPATH=$(srcdir) $(AWK) -f subslash.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/subslash.ok _$@ && rm -f _$@ + +opasnslf:: + @-AWKPATH=$(srcdir) $(AWK) -f opasnslf.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/opasnslf.ok _$@ && rm -f _$@ + +opasnidx:: + @-AWKPATH=$(srcdir) $(AWK) -f opasnidx.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/opasnidx.ok _$@ && rm -f _$@ + +arynocls:: + @-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@ + -$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@ + +igncdym:: + @-AWKPATH=$(srcdir) $(AWK) -f igncdym.awk $(srcdir)/igncdym.in >_$@ + -$(CMP) $(srcdir)/igncdym.ok _$@ && rm -f _$@ + +getlnbuf:: + @-AWKPATH=$(srcdir) $(AWK) -f getlnbuf.awk $(srcdir)/getlnbuf.in > _$@ + @-AWKPATH=$(srcdir) $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@ + -$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@ + +arysubnm:: + @-AWKPATH=$(srcdir) $(AWK) -f arysubnm.awk >_$@ + -$(CMP) $(srcdir)/arysubnm.ok _$@ && rm -f _$@ + +fnparydl:: + @-AWKPATH=$(srcdir) $(AWK) -f fnparydl.awk >_$@ + -$(CMP) $(srcdir)/fnparydl.ok _$@ && rm -f _$@ + +nlstrina:: + @-AWKPATH=$(srcdir) $(AWK) -f nlstrina.awk >_$@ + -$(CMP) $(srcdir)/nlstrina.ok _$@ && rm -f _$@ + +octsub:: + @-AWKPATH=$(srcdir) $(AWK) -f octsub.awk >_$@ + -$(CMP) $(srcdir)/octsub.ok _$@ && rm -f _$@ + +nlinstr:: + @$(AWK) -f $(srcdir)/nlinstr.awk $(srcdir)/nlinstr.in >_$@ + -$(CMP) $(srcdir)/nlinstr.ok _$@ && rm -f _$@ + +ofmt:: + @$(AWK) -f $(srcdir)/ofmt.awk $(srcdir)/ofmt.in >_$@ + -$(CMP) $(srcdir)/ofmt.ok _$@ && rm -f _$@ + +hsprint:: + @$(AWK) -f $(srcdir)/hsprint.awk >_$@ + -$(CMP) $(srcdir)/hsprint.ok _$@ && rm -f _$@ + +fsfwfs:: + @$(AWK) -f $(srcdir)/fsfwfs.awk $(srcdir)/fsfwfs.in >_$@ + -$(CMP) $(srcdir)/fsfwfs.ok _$@ && rm -f _$@ + +ofmts:: + @$(AWK) -f $(srcdir)/ofmts.awk $(srcdir)/ofmts.in >_$@ + -$(CMP) $(srcdir)/ofmts.ok _$@ && rm -f _$@ + +parseme:: + @-AWKPATH=$(srcdir) $(AWK) -f parseme.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/parseme.ok _$@ && rm -f _$@ + +splitdef:: + @$(AWK) -f $(srcdir)/splitdef.awk >_$@ + -$(CMP) $(srcdir)/splitdef.ok _$@ && rm -f _$@ + +fnaryscl:: + @-AWKPATH=$(srcdir) $(AWK) -f fnaryscl.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/fnaryscl.ok _$@ && rm -f _$@ + +fnasgnm:: + @-AWKPATH=$(srcdir) $(AWK) -f fnasgnm.awk < $(srcdir)/fnasgnm.in >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/fnasgnm.ok _$@ && rm -f _$@ + +lint:: + @-AWKPATH=$(srcdir) $(AWK) -f lint.awk > _$@ 2>&1 + -$(CMP) $(srcdir)/lint.ok _$@ && rm -f _$@ + +procinfs:: + @-$(AWK) -f $(srcdir)/procinfs.awk > _$@ + -$(CMP) $(srcdir)/procinfs.ok _$@ && rm -f _$@ + +sort1:: + @-$(AWK) -f $(srcdir)/sort1.awk > _$@ + -$(CMP) $(srcdir)/sort1.ok _$@ && rm -f _$@ + +ofmtbig:: + @$(AWK) -f $(srcdir)/ofmtbig.awk $(srcdir)/ofmtbig.in >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/ofmtbig.ok _$@ && rm -f _$@ + +inetmesg:: + @echo These tests only work if your system supports the services + @echo "'discard'" at port 9 and "'daytimed" at port 13. Check your + @echo file /etc/services and do "'netstat -a'". + +inetechu:: + @echo This test is for establishing UDP connections + @$(AWK) 'BEGIN {print "" |& "/inet/udp/0/127.0.0.1/9"}' + +inetecht:: + @echo This test is for establishing TCP connections + @$(AWK) 'BEGIN {print "" |& "/inet/tcp/0/127.0.0.1/9"}' + +inetdayu:: + @echo This test is for bidirectional UDP transmission + @$(AWK) 'BEGIN { print "" |& "/inet/udp/0/127.0.0.1/13"; \ + "/inet/udp/0/127.0.0.1/13" |& getline; print $0}' + +inetdayt:: + @echo This test is for bidirectional TCP transmission + @$(AWK) 'BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13"; \ + "/inet/tcp/0/127.0.0.1/13" |& getline; print $0}' + +paramtyp:: + @$(AWK) -f $(srcdir)/paramtyp.awk >_$@ + -$(CMP) $(srcdir)/paramtyp.ok _$@ && rm -f _$@ + +rsnul1nl:: + @$(AWK) -f $(srcdir)/rsnul1nl.awk $(srcdir)/rsnul1nl.in >_$@ + -$(CMP) $(srcdir)/rsnul1nl.ok _$@ && rm -f _$@ + +datanonl:: + @$(AWK) -f $(srcdir)/datanonl.awk $(srcdir)/datanonl.in >_$@ + -$(CMP) $(srcdir)/datanonl.ok _$@ && rm -f _$@ + +regeq:: + @$(AWK) -f $(srcdir)/regeq.awk $(srcdir)/regeq.in >_$@ + -$(CMP) $(srcdir)/regeq.ok _$@ && rm -f _$@ + +redfilnm:: + @$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@ + -$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@ + +strtod:: + @$(AWK) -f $(srcdir)/strtod.awk $(srcdir)/strtod.in >_$@ + -$(CMP) $(srcdir)/strtod.ok _$@ && rm -f _$@ + +leaddig:: + @$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@ + -$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@ + +clos1way:: + @$(AWK) -f $(srcdir)/clos1way.awk >_$@ + -$(CMP) $(srcdir)/clos1way.ok _$@ && rm -f _$@ + +arynasty:: + @$(AWK) -f $(srcdir)/arynasty.awk >_$@ + -$(CMP) $(srcdir)/arynasty.ok _$@ && rm -f _$@ + +shadow:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f shadow.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/shadow.ok _$@ && rm -f _$@ + +regx8bit:: + @$(AWK) -f $(srcdir)/regx8bit.awk >_$@ + -$(CMP) $(srcdir)/regx8bit.ok _$@ && rm -f _$@ + +psx96sub:: + @$(AWK) -f $(srcdir)/psx96sub.awk >_$@ + -$(CMP) $(srcdir)/psx96sub.ok _$@ && rm -f _$@ + +addcomma:: + @$(AWK) -f $(srcdir)/addcomma.awk $(srcdir)/addcomma.in >_$@ + -$(CMP) $(srcdir)/addcomma.ok _$@ && rm -f _$@ + +gnuops2:: + @$(AWK) -f $(srcdir)/gnuops2.awk >_$@ + -$(CMP) $(srcdir)/gnuops2.ok _$@ && rm -f _$@ + +rebt8b1:: + @$(AWK) -f $(srcdir)/rebt8b1.awk >_$@ + -$(CMP) $(srcdir)/rebt8b1.ok _$@ && rm -f _$@ + +rebt8b2:: + @$(AWK) -f $(srcdir)/rebt8b2.awk >_$@ + -$(CMP) $(srcdir)/rebt8b2.ok _$@ && rm -f _$@ + +leadnl:: + @$(AWK) -f $(srcdir)/leadnl.awk $(srcdir)/leadnl.in >_$@ + -$(CMP) $(srcdir)/leadnl.ok _$@ && rm -f _$@ + +funsemnl:: + @$(AWK) -f $(srcdir)/funsemnl.awk >_$@ + -$(CMP) $(srcdir)/funsemnl.ok _$@ && rm -f _$@ + +clean: + rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~ + +# This target for my convenience to look at all the results +diffout: + for i in _* ; \ + do \ + echo ============== $$i ============= ; \ + diff -c $${i#_}.ok $$i ; \ + done | more diff --git a/test/Makefile.in b/test/Makefile.in index 39f1dc48..a02467ee 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,59 +1,583 @@ -# Makefile for GNU Awk test suite. +# Makefile.in generated automatically by automake 1.4a from Makefile.am + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_FLAG = +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : + +@SET_MAKE@ +AMDEP = @AMDEP@ +AMTAR = @AMTAR@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +DATADIRNAME = @DATADIRNAME@ +DEPDIR = @DEPDIR@ +GENCAT = @GENCAT@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SOCKET_LIBS = @SOCKET_LIBS@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +YACC = @YACC@ +install_sh = @install_sh@ +l = @l@ + +# +# test/Makefile.am --- automake input file for gawk +# +# Copyright (C) 1988-2001 the Free Software Foundation, Inc. # -# Copyright (C) 1988-2000 the Free Software Foundation, Inc. -# # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. -# +# # GAWK is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. -# +# # GAWK is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# -SHELL = /bin/sh -AWK = ../gawk -CMP = cmp - -srcdir = @srcdir@ -VPATH = @srcdir@ - -bigtest: basic unix-tests gawk.extensions -basic: msg swaplns messages argarray longwrds \ - getline fstabplus compare arrayref rs fsrs rand \ - fsbs negexp asgext anchgsub splitargv awkpath nfset reparse \ - convfmt arrayparm paramdup nonl defref nofmtch litoct resplit \ - rswhite prmarscl sclforin sclifin intprec childin noeffect \ - numsubstr pcntplus prmreuse math fldchg fldchgnf reindops \ - sprintfc backgsub tweakfld clsflnam mmap8k fnarray \ - dynlj substr eofsplit prt1eval gsubasgn prtoeval gsubtest splitwht \ - back89 tradanch nlfldsep splitvar intest nfldstr nors fnarydel \ - noparms funstack clobber delarprm prdupval nasty zeroflag \ - getnr2tm getnr2tb printf1 funsmnam fnamedat numindex subslash \ - opasnslf opasnidx arynocls getlnbuf arysubnm fnparydl nlstrina +EXTRA_DIST = \ + reg \ + lib \ + README \ + addcomma.awk \ + addcomma.in \ + addcomma.ok \ + anchgsub.awk \ + anchgsub.in \ + anchgsub.ok \ + argarray.awk \ + argarray.in \ + argarray.ok \ + argtest.awk \ + argtest.ok \ + arrayparm.awk \ + arrayparm.ok \ + arrayref.awk \ + arrayref.ok \ + arynasty.awk \ + arynasty.ok \ + arynocls.awk \ + arynocls.in \ + arynocls.ok \ + arysubnm.awk \ + arysubnm.ok \ + asgext.awk \ + asgext.in \ + asgext.ok \ + awkpath.ok \ + back89.in \ + back89.ok \ + backgsub.awk \ + backgsub.in \ + backgsub.ok \ + badargs.ok \ + childin.ok \ + clobber.awk \ + clobber.ok \ + clos1way.awk \ + clos1way.ok \ + clsflnam.awk \ + clsflnam.in \ + clsflnam.ok \ + compare.awk \ + compare.in \ + compare.ok \ + convfmt.awk \ + convfmt.ok \ + datanonl.awk \ + datanonl.in \ + datanonl.ok \ + defref.awk \ + defref.ok \ + delarprm.awk \ + delarprm.ok \ + dynlj.awk \ + dynlj.ok \ + eofsplit.awk \ + eofsplit.ok \ + fflush.ok \ + fflush.sh \ + fieldwdth.ok \ + fldchg.awk \ + fldchg.in \ + fldchg.ok \ + fldchgnf.awk \ + fldchgnf.in \ + fldchgnf.ok \ + fnamedat.awk \ + fnamedat.in \ + fnamedat.ok \ + fnarray.awk \ + fnarray.ok \ + fnarydel.awk \ + fnarydel.ok \ + fnaryscl.awk \ + fnaryscl.ok \ + fnasgnm.awk \ + fnasgnm.in \ + fnasgnm.ok \ + fnparydl.awk \ + fnparydl.ok \ + fsbs.in \ + fsbs.ok \ + fsfwfs.awk \ + fsfwfs.in \ + fsfwfs.ok \ + fsrs.awk \ + fsrs.in \ + fsrs.ok \ + fstabplus.awk \ + fstabplus.ok \ + funsemnl.awk \ + funsemnl.ok \ + funsmnam.awk \ + funsmnam.ok \ + funstack.awk \ + funstack.in \ + funstack.ok \ + gensub.awk \ + gensub.in \ + gensub.ok \ + getline.awk \ + getline.ok \ + getlnbuf.awk \ + getlnbuf.in \ + getlnbuf.ok \ + getlnhd.awk \ + getlnhd.ok \ + getnr2tb.awk \ + getnr2tb.in \ + getnr2tb.ok \ + getnr2tm.awk \ + getnr2tm.in \ + getnr2tm.ok \ + gnuops2.awk \ + gnuops2.ok \ + gnureops.awk \ + gnureops.ok \ + gsubasgn.awk \ + gsubasgn.ok \ + gsubtest.awk \ + gsubtest.ok \ + gtlnbufv.awk \ + hsprint.awk \ + hsprint.ok \ + igncdym.awk \ + igncdym.in \ + igncdym.ok \ + igncfs.awk \ + igncfs.in \ + igncfs.ok \ + ignrcase.ok \ + inftest.awk \ + inftest.ok \ + intest.awk \ + intest.ok \ + intprec.awk \ + intprec.ok \ + leaddig.awk \ + leaddig.ok \ + leadnl.awk \ + leadnl.in \ + leadnl.ok \ + lint.awk \ + lint.ok \ + litoct.awk \ + litoct.ok \ + longwrds.awk \ + longwrds.ok \ + manpage \ + manyfiles.awk \ + math.awk \ + math.ok \ + messages.awk \ + mmap8k.in \ + nasty.awk \ + nasty.ok \ + nasty2.awk \ + nasty2.ok \ + negexp.ok \ + nfldstr.ok \ + nfset.awk \ + nfset.in \ + nfset.ok \ + nlfldsep.awk \ + nlfldsep.in \ + nlfldsep.ok \ + nlinstr.awk \ + nlinstr.in \ + nlinstr.ok \ + nlstrina.awk \ + nlstrina.ok \ + noeffect.awk \ + noeffect.ok \ + nofmtch.awk \ + nofmtch.ok \ + nondec.awk \ + nondec.ok \ + nonl.awk \ + nonl.ok \ + noparms.awk \ + noparms.ok \ + nors.in \ + nors.ok \ + numindex.awk \ + numindex.in \ + numindex.ok \ + numsubstr.awk \ + numsubstr.in \ + numsubstr.ok \ + octsub.awk \ + octsub.ok \ + ofmt.awk \ + ofmt.in \ + ofmt.ok \ + ofmtbig.awk \ + ofmtbig.in \ + ofmtbig.ok \ + ofmts.awk \ + ofmts.in \ + ofmts.ok \ + opasnidx.awk \ + opasnidx.ok \ + opasnslf.awk \ + opasnslf.ok \ + out1.ok \ + out2.ok \ + out3.ok \ + paramdup.awk \ + paramdup.ok \ + paramtyp.awk \ + paramtyp.ok \ + parseme.awk \ + parseme.ok \ + pcntplus.awk \ + pcntplus.ok \ + pid.awk \ + pid.ok \ + pid.sh \ + pipeio1.awk \ + pipeio1.ok \ + pipeio2.awk \ + pipeio2.in \ + pipeio2.ok \ + posix.awk \ + posix.ok \ + poundbang.awk \ + poundbang.ok \ + prdupval.awk \ + prdupval.in \ + prdupval.ok \ + printf1.awk \ + printf1.ok \ + printfloat.awk \ + prmarscl.awk \ + prmarscl.ok \ + prmreuse.awk \ + prmreuse.ok \ + procinfs.awk \ + procinfs.ok \ + prt1eval.awk \ + prt1eval.ok \ + prtoeval.awk \ + prtoeval.ok \ + psx96sub.awk \ + psx96sub.ok \ + rand.awk \ + rand.ok \ + rebt8b1.awk \ + rebt8b1.ok \ + rebt8b2.awk \ + rebt8b2.ok \ + redfilnm.awk \ + redfilnm.in \ + redfilnm.ok \ + regeq.awk \ + regeq.in \ + regeq.ok \ + regtest.sh \ + regx8bit.awk \ + regx8bit.ok \ + reindops.awk \ + reindops.in \ + reindops.ok \ + reint.awk \ + reint.in \ + reint.ok \ + reparse.awk \ + reparse.in \ + reparse.ok \ + resplit.ok \ + rs.in \ + rs.ok \ + rsnul1nl.awk \ + rsnul1nl.in \ + rsnul1nl.ok \ + rswhite.awk \ + rswhite.in \ + rswhite.ok \ + sclforin.awk \ + sclforin.ok \ + sclifin.awk \ + sclifin.ok \ + shadow.awk \ + shadow.ok \ + sort1.awk \ + sort1.ok \ + splitargv.awk \ + splitargv.in \ + splitargv.ok \ + splitdef.awk \ + splitdef.ok \ + splitvar.awk \ + splitvar.in \ + splitvar.ok \ + splitwht.awk \ + splitwht.ok \ + sprintfc.awk \ + sprintfc.in \ + sprintfc.ok \ + strtod.awk \ + strtod.in \ + strtod.ok \ + strftime.awk \ + strftlng.awk \ + strftlng.ok \ + subslash.awk \ + subslash.ok \ + substr.awk \ + substr.ok \ + swaplns.awk \ + swaplns.in \ + swaplns.ok \ + tradanch.awk \ + tradanch.in \ + tradanch.ok \ + tweakfld.awk \ + tweakfld.in \ + tweakfld.ok \ + zeroflag.awk \ + zeroflag.ok -unix-tests: poundbang fflush getlnhd pipeio1 pipeio2 strftlng pid -gawk.extensions: fieldwdth ignrcase posix manyfiles igncfs argtest \ - badargs strftime gensub gnureops reint igncdym -# add this back for 3.1 -# nondec +CMP = cmp +AWK = ../gawk +subdir = test +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = README ChangeLog Makefile.am Makefile.in -extra: regtest inftest -poundbang:: - @cp $(AWK) /tmp/gawk && $(srcdir)/poundbang $(srcdir)/poundbang >_`basename $@` - @rm -f /tmp/gawk - $(CMP) $(srcdir)/poundbang.ok _`basename $@` && rm -f _`basename $@` +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + -rm -f Makefile.in +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all install-strip installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +# message stuff is to make it a little easier to follow +check: msg \ + basic-msg-start basic basic-msg-end \ + unix-msg-start unix-tests unix-msg-end \ + extend-msg-start gawk-extensions extend-msg-end + +# try to keep these sorted +basic: addcomma anchgsub argarray arrayparm arrayref arynasty arynocls \ + arysubnm asgext awkpath back89 backgsub childin clobber clsflnam \ + compare convfmt datanonl defref delarprm dynlj eofsplit fldchg \ + fldchgnf fnamedat fnarray fnarydel fnaryscl fnasgnm fnparydl \ + fsbs fsrs fstabplus funsemnl funsmnam funstack getline getlnbuf getnr2tb \ + getnr2tm gsubasgn gsubtest hsprint intest intprec leaddig leadnl litoct \ + longwrds math messages mmap8k nasty nasty2 negexp nfldstr nfset \ + nlfldsep nlinstr nlstrina noeffect nofmtch nonl noparms nors \ + numindex numsubstr octsub ofmt ofmtbig ofmts opasnidx opasnslf \ + paramdup paramtyp parseme pcntplus prdupval printf1 prmarscl \ + prmreuse prt1eval prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm \ + regeq reindops reparse resplit rs rsnul1nl rswhite sclforin \ + sclifin splitargv splitdef splitvar splitwht sprintfc strtod \ + subslash substr swaplns tradanch tweakfld zeroflag + +unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundbang strftlng + +gawk-extensions: argtest badargs clos1way fieldwdth fsfwfs gensub \ + gnuops2 gnureops igncdym igncfs ignrcase lint manyfiles nondec \ + posix procinfs regx8bit reint shadow sort1 strftime + +extra: regtest inftest inet + +inet: inetmesg inetechu inetecht inetdayu inetdayt msg:: @echo 'Any output from "cmp" is bad news, although some differences' @@ -61,16 +585,44 @@ msg:: @echo 'some systems may omit a leading zero and the floating point' @echo 'precision may lead to slightly different output in a few cases.' +basic-msg-start: + @echo "======== Starting basic tests ========" + +basic-msg-end: + @echo "======== Done with basic tests ========" + +unix-msg-start: + @echo "======== Starting Unix tests ========" + +unix-msg-end: + @echo "======== Done with Unix tests ========" + +extend-msg-start: + @echo "======== Starting gawk extension tests ========" + +extend-msg-end: + @echo "======== Done with gawk extension tests ========" + +# This test is a PITA because increasingly, /tmp is getting +# mounted noexec. So, we'll test it. Sigh. +poundbang:: + @cp $(AWK) /tmp/gawk + @if /tmp/gawk 'BEGIN { print "OK" }' | grep OK > /dev/null ; \ + then \ + $(srcdir)/poundbang.awk $(srcdir)/poundbang.awk >_`basename $@` ; \ + $(CMP) $(srcdir)/poundbang.ok _`basename $@` && rm -f _`basename $@` && echo poundbang is ok ; \ + else \ + echo "*** /tmp is apparently mounted noexec, skipping poundbang test." ; \ + fi + @rm -f /tmp/gawk + swaplns:: @$(AWK) -f $(srcdir)/swaplns.awk $(srcdir)/swaplns.in >_$@ - $(CMP) $(srcdir)/swaplns.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/swaplns.ok _$@ && rm -f _$@ messages:: @$(AWK) -f $(srcdir)/messages.awk >out2 2>out3 - { $(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && \ - $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3; } || \ - { { test -d /dev/fd || test -d /proc/self/fd; } && \ - echo IT IS OK THAT THIS TEST FAILED; } + -$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3 argarray:: @case $(srcdir) in \ @@ -78,41 +630,41 @@ argarray:: *) cp $(srcdir)/argarray.in . ;; \ esac @TEST=test echo just a test | $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@ - $(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@ fstabplus:: @echo '1 2' | $(AWK) -f $(srcdir)/fstabplus.awk >_$@ - $(CMP) $(srcdir)/fstabplus.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fstabplus.ok _$@ && rm -f _$@ fsrs:: @$(AWK) -f $(srcdir)/fsrs.awk $(srcdir)/fsrs.in >_$@ - $(CMP) $(srcdir)/fsrs.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fsrs.ok _$@ && rm -f _$@ igncfs:: @$(AWK) -f $(srcdir)/igncfs.awk $(srcdir)/igncfs.in >_$@ - $(CMP) $(srcdir)/igncfs.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/igncfs.ok _$@ && rm -f _$@ longwrds:: @$(AWK) -f $(srcdir)/longwrds.awk $(srcdir)/manpage | (LC_ALL=C sort) >_$@ - $(CMP) $(srcdir)/longwrds.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/longwrds.ok _$@ && rm -f _$@ fieldwdth:: @echo '123456789' | $(AWK) -v FIELDWIDTHS="2 3 4" '{ print $$2}' >_$@ - $(CMP) $(srcdir)/fieldwdth.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fieldwdth.ok _$@ && rm -f _$@ ignrcase:: @echo xYz | $(AWK) -v IGNORECASE=1 '{ sub(/y/, ""); print}' >_$@ - $(CMP) $(srcdir)/ignrcase.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/ignrcase.ok _$@ && rm -f _$@ regtest:: @echo 'Some of the output from regtest is very system specific, do not' @echo 'be distressed if your output differs from that distributed.' @echo 'Manual inspection is called for.' - AWK=`pwd`/$(AWK) $(srcdir)/regtest + AWK=`pwd`/$(AWK) $(srcdir)/regtest.awk posix:: @echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@ - $(CMP) $(srcdir)/posix.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/posix.ok _$@ && rm -f _$@ manyfiles:: @rm -rf junk @@ -125,315 +677,315 @@ manyfiles:: compare:: @$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@ - $(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@ arrayref:: @$(AWK) -f $(srcdir)/arrayref.awk >_$@ - $(CMP) $(srcdir)/arrayref.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/arrayref.ok _$@ && rm -f _$@ rs:: @$(AWK) -v RS="" '{ print $$1, $$2}' $(srcdir)/rs.in >_$@ - $(CMP) $(srcdir)/rs.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/rs.ok _$@ && rm -f _$@ fsbs:: @$(AWK) -v FS='\' '{ print $$1, $$2 }' $(srcdir)/fsbs.in >_$@ - $(CMP) $(srcdir)/fsbs.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fsbs.ok _$@ && rm -f _$@ inftest:: @echo This test is very machine specific... @$(AWK) -f $(srcdir)/inftest.awk >_$@ - $(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ getline:: @$(AWK) -f $(srcdir)/getline.awk $(srcdir)/getline.awk $(srcdir)/getline.awk >_$@ - $(CMP) $(srcdir)/getline.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/getline.ok _$@ && rm -f _$@ rand:: @$(AWK) -f $(srcdir)/rand.awk >_$@ - $(CMP) $(srcdir)/rand.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/rand.ok _$@ && rm -f _$@ negexp:: @$(AWK) 'BEGIN { a = -2; print 10^a }' >_$@ - $(CMP) $(srcdir)/negexp.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/negexp.ok _$@ && rm -f _$@ asgext:: @$(AWK) -f $(srcdir)/asgext.awk $(srcdir)/asgext.in >_$@ - $(CMP) $(srcdir)/asgext.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/asgext.ok _$@ && rm -f _$@ anchgsub:: @$(AWK) -f $(srcdir)/anchgsub.awk $(srcdir)/anchgsub.in >_$@ - $(CMP) $(srcdir)/anchgsub.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/anchgsub.ok _$@ && rm -f _$@ splitargv:: @$(AWK) -f $(srcdir)/splitargv.awk $(srcdir)/splitargv.in >_$@ - $(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@ awkpath:: @AWKPATH="$(srcdir):$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@ - $(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@ nfset:: @$(AWK) -f $(srcdir)/nfset.awk $(srcdir)/nfset.in >_$@ - $(CMP) $(srcdir)/nfset.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/nfset.ok _$@ && rm -f _$@ reparse:: @$(AWK) -f $(srcdir)/reparse.awk $(srcdir)/reparse.in >_$@ - $(CMP) $(srcdir)/reparse.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/reparse.ok _$@ && rm -f _$@ argtest:: @$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@ - $(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@ badargs:: @-$(AWK) -f 2>&1 | grep -v patchlevel >_$@ - $(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@ convfmt:: @$(AWK) -f $(srcdir)/convfmt.awk >_$@ - $(CMP) $(srcdir)/convfmt.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/convfmt.ok _$@ && rm -f _$@ arrayparm:: @-AWKPATH=$(srcdir) $(AWK) -f arrayparm.awk >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/arrayparm.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/arrayparm.ok _$@ && rm -f _$@ paramdup:: @-AWKPATH=$(srcdir) $(AWK) -f paramdup.awk >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/paramdup.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/paramdup.ok _$@ && rm -f _$@ nonl:: @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1 - $(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@ defref:: @-AWKPATH=$(srcdir) $(AWK) --lint -f defref.awk >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/defref.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/defref.ok _$@ && rm -f _$@ nofmtch:: @-AWKPATH=$(srcdir) $(AWK) --lint -f nofmtch.awk >_$@ 2>&1 - $(CMP) $(srcdir)/nofmtch.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/nofmtch.ok _$@ && rm -f _$@ strftime:: : this test could fail on slow machines or on a second boundary, : so if it does, double check the actual results @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ date | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk - $(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 + -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 litoct:: @echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@ - $(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@ gensub:: @$(AWK) -f $(srcdir)/gensub.awk $(srcdir)/gensub.in >_$@ - $(CMP) $(srcdir)/gensub.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/gensub.ok _$@ && rm -f _$@ resplit:: @echo a:b:c d:e:f | $(AWK) '{ FS = ":"; $$0 = $$0; print $$2 }' > _$@ - $(CMP) $(srcdir)/resplit.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/resplit.ok _$@ && rm -f _$@ rswhite:: @$(AWK) -f $(srcdir)/rswhite.awk $(srcdir)/rswhite.in > _$@ - $(CMP) $(srcdir)/rswhite.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/rswhite.ok _$@ && rm -f _$@ prmarscl:: @-AWKPATH=$(srcdir) $(AWK) -f prmarscl.awk > _$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/prmarscl.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/prmarscl.ok _$@ && rm -f _$@ sclforin:: @-AWKPATH=$(srcdir) $(AWK) -f sclforin.awk > _$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/sclforin.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/sclforin.ok _$@ && rm -f _$@ sclifin:: @-AWKPATH=$(srcdir) $(AWK) -f sclifin.awk > _$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/sclifin.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/sclifin.ok _$@ && rm -f _$@ intprec:: @-$(AWK) -f $(srcdir)/intprec.awk > _$@ 2>&1 - $(CMP) $(srcdir)/intprec.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/intprec.ok _$@ && rm -f _$@ childin:: @echo hi | $(AWK) 'BEGIN { "cat" | getline; print; close("cat") }' > _$@ - $(CMP) $(srcdir)/childin.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/childin.ok _$@ && rm -f _$@ noeffect:: @-AWKPATH=$(srcdir) $(AWK) --lint -f noeffect.awk > _$@ 2>&1 - $(CMP) $(srcdir)/noeffect.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/noeffect.ok _$@ && rm -f _$@ numsubstr:: @-AWKPATH=$(srcdir) $(AWK) -f numsubstr.awk $(srcdir)/numsubstr.in >_$@ - $(CMP) $(srcdir)/numsubstr.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/numsubstr.ok _$@ && rm -f _$@ gnureops:: @$(AWK) -f $(srcdir)/gnureops.awk >_$@ - $(CMP) $(srcdir)/gnureops.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/gnureops.ok _$@ && rm -f _$@ pcntplus:: @$(AWK) -f $(srcdir)/pcntplus.awk >_$@ - $(CMP) $(srcdir)/pcntplus.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/pcntplus.ok _$@ && rm -f _$@ prmreuse:: @$(AWK) -f $(srcdir)/prmreuse.awk >_$@ - $(CMP) $(srcdir)/prmreuse.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/prmreuse.ok _$@ && rm -f _$@ math:: @$(AWK) -f $(srcdir)/math.awk >_$@ - $(CMP) $(srcdir)/math.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/math.ok _$@ && rm -f _$@ fflush:: @$(srcdir)/fflush.sh >_$@ - $(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@ fldchg:: @$(AWK) -f $(srcdir)/fldchg.awk $(srcdir)/fldchg.in >_$@ - $(CMP) $(srcdir)/fldchg.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fldchg.ok _$@ && rm -f _$@ fldchgnf:: @$(AWK) -f $(srcdir)/fldchgnf.awk $(srcdir)/fldchgnf.in >_$@ - $(CMP) $(srcdir)/fldchgnf.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fldchgnf.ok _$@ && rm -f _$@ reindops:: @$(AWK) -f $(srcdir)/reindops.awk $(srcdir)/reindops.in >_$@ - $(CMP) $(srcdir)/reindops.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/reindops.ok _$@ && rm -f _$@ sprintfc:: @$(AWK) -f $(srcdir)/sprintfc.awk $(srcdir)/sprintfc.in >_$@ - $(CMP) $(srcdir)/sprintfc.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/sprintfc.ok _$@ && rm -f _$@ getlnhd:: @$(AWK) -f $(srcdir)/getlnhd.awk >_$@ - $(CMP) $(srcdir)/getlnhd.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/getlnhd.ok _$@ && rm -f _$@ backgsub:: @$(AWK) -f $(srcdir)/backgsub.awk $(srcdir)/backgsub.in >_$@ - $(CMP) $(srcdir)/backgsub.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/backgsub.ok _$@ && rm -f _$@ tweakfld:: @$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@ @rm -f errors.cleanup - $(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@ clsflnam:: - @$(AWK) -f $(srcdir)/clsflnam.awk $(srcdir)/clsflnam.in >_$@ - $(CMP) $(srcdir)/clsflnam.ok _$@ && rm -f _$@ + @$(AWK) -f $(srcdir)/clsflnam.awk $(srcdir)/clsflnam.in >_$@ 2>&1 + -$(CMP) $(srcdir)/clsflnam.ok _$@ && rm -f _$@ mmap8k:: @$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@ - $(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@ + -$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@ fnarray:: @-AWKPATH=$(srcdir) $(AWK) -f fnarray.awk >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/fnarray.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fnarray.ok _$@ && rm -f _$@ dynlj:: @$(AWK) -f $(srcdir)/dynlj.awk >_$@ - $(CMP) $(srcdir)/dynlj.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/dynlj.ok _$@ && rm -f _$@ substr:: @$(AWK) -f $(srcdir)/substr.awk >_$@ - $(CMP) $(srcdir)/substr.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/substr.ok _$@ && rm -f _$@ eofsplit:: @$(AWK) -f $(srcdir)/eofsplit.awk >_$@ - $(CMP) $(srcdir)/eofsplit.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/eofsplit.ok _$@ && rm -f _$@ prt1eval:: @$(AWK) -f $(srcdir)/prt1eval.awk >_$@ - $(CMP) $(srcdir)/prt1eval.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/prt1eval.ok _$@ && rm -f _$@ gsubasgn:: @-AWKPATH=$(srcdir) $(AWK) -f gsubasgn.awk >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/gsubasgn.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/gsubasgn.ok _$@ && rm -f _$@ prtoeval:: @$(AWK) -f $(srcdir)/prtoeval.awk >_$@ - $(CMP) $(srcdir)/prtoeval.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/prtoeval.ok _$@ && rm -f _$@ gsubtest:: @$(AWK) -f $(srcdir)/gsubtest.awk >_$@ - $(CMP) $(srcdir)/gsubtest.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/gsubtest.ok _$@ && rm -f _$@ splitwht:: @$(AWK) -f $(srcdir)/splitwht.awk >_$@ - $(CMP) $(srcdir)/splitwht.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/splitwht.ok _$@ && rm -f _$@ back89:: @$(AWK) '/a\8b/' $(srcdir)/back89.in >_$@ - $(CMP) $(srcdir)/back89.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/back89.ok _$@ && rm -f _$@ tradanch:: @$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@ - $(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@ nlfldsep:: @$(AWK) -f $(srcdir)/nlfldsep.awk $(srcdir)/nlfldsep.in > _$@ - $(CMP) $(srcdir)/nlfldsep.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/nlfldsep.ok _$@ && rm -f _$@ splitvar:: @$(AWK) -f $(srcdir)/splitvar.awk $(srcdir)/splitvar.in >_$@ - $(CMP) $(srcdir)/splitvar.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/splitvar.ok _$@ && rm -f _$@ intest:: @$(AWK) -f $(srcdir)/intest.awk >_$@ - $(CMP) $(srcdir)/intest.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/intest.ok _$@ && rm -f _$@ # AIX /bin/sh exec's the last command in a list, therefore issue a ":" # command so that pid.sh is fork'ed as a child before being exec'ed. pid:: @AWKPATH=$(srcdir) AWK=$(AWK) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; : - $(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in + -$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in strftlng:: @TZ=UTC; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ @if $(CMP) -s $(srcdir)/strftlng.ok _$@ ; then : ; else \ - TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \ + TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \ fi - $(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@ nfldstr:: @echo | $(AWK) '$$1 == 0 { print "bug" }' > _$@ - $(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@ nors:: @echo A B C D E | tr -d '\12' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ - $(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ fnarydel:: @$(AWK) -f $(srcdir)/fnarydel.awk >_$@ - $(CMP) $(srcdir)/fnarydel.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fnarydel.ok _$@ && rm -f _$@ reint:: @$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@ - $(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@ noparms:: @-AWKPATH=$(srcdir) $(AWK) -f noparms.awk >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/noparms.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/noparms.ok _$@ && rm -f _$@ pipeio1:: @$(AWK) -f $(srcdir)/pipeio1.awk >_$@ @rm -f test1 test2 - $(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@ pipeio2:: @$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@ - $(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@ funstack:: @$(AWK) -f $(srcdir)/funstack.awk $(srcdir)/funstack.in >_$@ - $(CMP) $(srcdir)/funstack.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/funstack.ok _$@ && rm -f _$@ clobber:: @$(AWK) -f $(srcdir)/clobber.awk >_$@ - $(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@ @rm -f seq delarprm:: @$(AWK) -f $(srcdir)/delarprm.awk >_$@ - $(CMP) $(srcdir)/delarprm.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/delarprm.ok _$@ && rm -f _$@ prdupval:: @$(AWK) -f $(srcdir)/prdupval.awk $(srcdir)/prdupval.in >_$@ - $(CMP) $(srcdir)/prdupval.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/prdupval.ok _$@ && rm -f _$@ nondec:: @if grep BITOP ../config.h | grep define > /dev/null; \ @@ -442,81 +994,243 @@ nondec:: else \ cp $(srcdir)/nondec.ok _$@; \ fi - $(CMP) $(srcdir)/nondec.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/nondec.ok _$@ && rm -f _$@ nasty:: @$(AWK) -f $(srcdir)/nasty.awk >_$@ - $(CMP) $(srcdir)/nasty.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/nasty.ok _$@ && rm -f _$@ + +nasty2:: + @$(AWK) -f $(srcdir)/nasty2.awk >_$@ + -$(CMP) $(srcdir)/nasty2.ok _$@ && rm -f _$@ zeroflag:: @$(AWK) -f $(srcdir)/zeroflag.awk >_$@ - $(CMP) $(srcdir)/zeroflag.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/zeroflag.ok _$@ && rm -f _$@ getnr2tm:: @$(AWK) -f $(srcdir)/getnr2tm.awk $(srcdir)/getnr2tm.in >_$@ - $(CMP) $(srcdir)/getnr2tm.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/getnr2tm.ok _$@ && rm -f _$@ getnr2tb:: @$(AWK) -f $(srcdir)/getnr2tb.awk $(srcdir)/getnr2tb.in >_$@ - $(CMP) $(srcdir)/getnr2tb.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/getnr2tb.ok _$@ && rm -f _$@ printf1:: @$(AWK) -f $(srcdir)/printf1.awk >_$@ - $(CMP) $(srcdir)/printf1.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/printf1.ok _$@ && rm -f _$@ funsmnam:: @-AWKPATH=$(srcdir) $(AWK) -f funsmnam.awk >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/funsmnam.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/funsmnam.ok _$@ && rm -f _$@ fnamedat:: @-AWKPATH=$(srcdir) $(AWK) -f fnamedat.awk < $(srcdir)/fnamedat.in >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/fnamedat.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fnamedat.ok _$@ && rm -f _$@ numindex:: @-AWKPATH=$(srcdir) $(AWK) -f numindex.awk < $(srcdir)/numindex.in >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/numindex.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/numindex.ok _$@ && rm -f _$@ subslash:: @-AWKPATH=$(srcdir) $(AWK) -f subslash.awk >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/subslash.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/subslash.ok _$@ && rm -f _$@ opasnslf:: @-AWKPATH=$(srcdir) $(AWK) -f opasnslf.awk >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/opasnslf.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/opasnslf.ok _$@ && rm -f _$@ opasnidx:: @-AWKPATH=$(srcdir) $(AWK) -f opasnidx.awk >_$@ 2>&1 || exit 0 - $(CMP) $(srcdir)/opasnidx.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/opasnidx.ok _$@ && rm -f _$@ arynocls:: @-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@ - $(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@ igncdym:: @-AWKPATH=$(srcdir) $(AWK) -f igncdym.awk $(srcdir)/igncdym.in >_$@ - $(CMP) $(srcdir)/igncdym.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/igncdym.ok _$@ && rm -f _$@ getlnbuf:: @-AWKPATH=$(srcdir) $(AWK) -f getlnbuf.awk $(srcdir)/getlnbuf.in > _$@ @-AWKPATH=$(srcdir) $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@ - $(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@ + -$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@ arysubnm:: @-AWKPATH=$(srcdir) $(AWK) -f arysubnm.awk >_$@ - $(CMP) $(srcdir)/arysubnm.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/arysubnm.ok _$@ && rm -f _$@ fnparydl:: @-AWKPATH=$(srcdir) $(AWK) -f fnparydl.awk >_$@ - $(CMP) $(srcdir)/fnparydl.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/fnparydl.ok _$@ && rm -f _$@ nlstrina:: @-AWKPATH=$(srcdir) $(AWK) -f nlstrina.awk >_$@ - $(CMP) $(srcdir)/nlstrina.ok _$@ && rm -f _$@ + -$(CMP) $(srcdir)/nlstrina.ok _$@ && rm -f _$@ + +octsub:: + @-AWKPATH=$(srcdir) $(AWK) -f octsub.awk >_$@ + -$(CMP) $(srcdir)/octsub.ok _$@ && rm -f _$@ + +nlinstr:: + @$(AWK) -f $(srcdir)/nlinstr.awk $(srcdir)/nlinstr.in >_$@ + -$(CMP) $(srcdir)/nlinstr.ok _$@ && rm -f _$@ + +ofmt:: + @$(AWK) -f $(srcdir)/ofmt.awk $(srcdir)/ofmt.in >_$@ + -$(CMP) $(srcdir)/ofmt.ok _$@ && rm -f _$@ + +hsprint:: + @$(AWK) -f $(srcdir)/hsprint.awk >_$@ + -$(CMP) $(srcdir)/hsprint.ok _$@ && rm -f _$@ + +fsfwfs:: + @$(AWK) -f $(srcdir)/fsfwfs.awk $(srcdir)/fsfwfs.in >_$@ + -$(CMP) $(srcdir)/fsfwfs.ok _$@ && rm -f _$@ + +ofmts:: + @$(AWK) -f $(srcdir)/ofmts.awk $(srcdir)/ofmts.in >_$@ + -$(CMP) $(srcdir)/ofmts.ok _$@ && rm -f _$@ + +parseme:: + @-AWKPATH=$(srcdir) $(AWK) -f parseme.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/parseme.ok _$@ && rm -f _$@ + +splitdef:: + @$(AWK) -f $(srcdir)/splitdef.awk >_$@ + -$(CMP) $(srcdir)/splitdef.ok _$@ && rm -f _$@ + +fnaryscl:: + @-AWKPATH=$(srcdir) $(AWK) -f fnaryscl.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/fnaryscl.ok _$@ && rm -f _$@ + +fnasgnm:: + @-AWKPATH=$(srcdir) $(AWK) -f fnasgnm.awk < $(srcdir)/fnasgnm.in >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/fnasgnm.ok _$@ && rm -f _$@ + +lint:: + @-AWKPATH=$(srcdir) $(AWK) -f lint.awk > _$@ 2>&1 + -$(CMP) $(srcdir)/lint.ok _$@ && rm -f _$@ + +procinfs:: + @-$(AWK) -f $(srcdir)/procinfs.awk > _$@ + -$(CMP) $(srcdir)/procinfs.ok _$@ && rm -f _$@ + +sort1:: + @-$(AWK) -f $(srcdir)/sort1.awk > _$@ + -$(CMP) $(srcdir)/sort1.ok _$@ && rm -f _$@ + +ofmtbig:: + @$(AWK) -f $(srcdir)/ofmtbig.awk $(srcdir)/ofmtbig.in >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/ofmtbig.ok _$@ && rm -f _$@ + +inetmesg:: + @echo These tests only work if your system supports the services + @echo "'discard'" at port 9 and "'daytimed" at port 13. Check your + @echo file /etc/services and do "'netstat -a'". + +inetechu:: + @echo This test is for establishing UDP connections + @$(AWK) 'BEGIN {print "" |& "/inet/udp/0/127.0.0.1/9"}' + +inetecht:: + @echo This test is for establishing TCP connections + @$(AWK) 'BEGIN {print "" |& "/inet/tcp/0/127.0.0.1/9"}' + +inetdayu:: + @echo This test is for bidirectional UDP transmission + @$(AWK) 'BEGIN { print "" |& "/inet/udp/0/127.0.0.1/13"; \ + "/inet/udp/0/127.0.0.1/13" |& getline; print $0}' + +inetdayt:: + @echo This test is for bidirectional TCP transmission + @$(AWK) 'BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13"; \ + "/inet/tcp/0/127.0.0.1/13" |& getline; print $0}' + +paramtyp:: + @$(AWK) -f $(srcdir)/paramtyp.awk >_$@ + -$(CMP) $(srcdir)/paramtyp.ok _$@ && rm -f _$@ + +rsnul1nl:: + @$(AWK) -f $(srcdir)/rsnul1nl.awk $(srcdir)/rsnul1nl.in >_$@ + -$(CMP) $(srcdir)/rsnul1nl.ok _$@ && rm -f _$@ + +datanonl:: + @$(AWK) -f $(srcdir)/datanonl.awk $(srcdir)/datanonl.in >_$@ + -$(CMP) $(srcdir)/datanonl.ok _$@ && rm -f _$@ + +regeq:: + @$(AWK) -f $(srcdir)/regeq.awk $(srcdir)/regeq.in >_$@ + -$(CMP) $(srcdir)/regeq.ok _$@ && rm -f _$@ + +redfilnm:: + @$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@ + -$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@ + +strtod:: + @$(AWK) -f $(srcdir)/strtod.awk $(srcdir)/strtod.in >_$@ + -$(CMP) $(srcdir)/strtod.ok _$@ && rm -f _$@ + +leaddig:: + @$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@ + -$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@ + +clos1way:: + @$(AWK) -f $(srcdir)/clos1way.awk >_$@ + -$(CMP) $(srcdir)/clos1way.ok _$@ && rm -f _$@ + +arynasty:: + @$(AWK) -f $(srcdir)/arynasty.awk >_$@ + -$(CMP) $(srcdir)/arynasty.ok _$@ && rm -f _$@ + +shadow:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f shadow.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/shadow.ok _$@ && rm -f _$@ + +regx8bit:: + @$(AWK) -f $(srcdir)/regx8bit.awk >_$@ + -$(CMP) $(srcdir)/regx8bit.ok _$@ && rm -f _$@ + +psx96sub:: + @$(AWK) -f $(srcdir)/psx96sub.awk >_$@ + -$(CMP) $(srcdir)/psx96sub.ok _$@ && rm -f _$@ + +addcomma:: + @$(AWK) -f $(srcdir)/addcomma.awk $(srcdir)/addcomma.in >_$@ + -$(CMP) $(srcdir)/addcomma.ok _$@ && rm -f _$@ + +gnuops2:: + @$(AWK) -f $(srcdir)/gnuops2.awk >_$@ + -$(CMP) $(srcdir)/gnuops2.ok _$@ && rm -f _$@ + +rebt8b1:: + @$(AWK) -f $(srcdir)/rebt8b1.awk >_$@ + -$(CMP) $(srcdir)/rebt8b1.ok _$@ && rm -f _$@ + +rebt8b2:: + @$(AWK) -f $(srcdir)/rebt8b2.awk >_$@ + -$(CMP) $(srcdir)/rebt8b2.ok _$@ && rm -f _$@ + +leadnl:: + @$(AWK) -f $(srcdir)/leadnl.awk $(srcdir)/leadnl.in >_$@ + -$(CMP) $(srcdir)/leadnl.ok _$@ && rm -f _$@ + +funsemnl:: + @$(AWK) -f $(srcdir)/funsemnl.awk >_$@ + -$(CMP) $(srcdir)/funsemnl.ok _$@ && rm -f _$@ clean: rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~ -distclean: clean - rm -f Makefile - -maintainer-clean: distclean +# This target for my convenience to look at all the results +diffout: + for i in _* ; \ + do \ + echo ============== $$i ============= ; \ + diff -c $${i#_}.ok $$i ; \ + done | more + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/test/addcomma.awk b/test/addcomma.awk new file mode 100644 index 00000000..8f52f36b --- /dev/null +++ b/test/addcomma.awk @@ -0,0 +1,15 @@ +# addcomma - put commas in numbers +# input: a number per line +# output: the input number followed by +# the number with commas and two decimal places + +{ printf("%-12s %20s\n", $0, addcomma($0)) } + +function addcomma(x, num) { + if (x < 0) + return "-" addcomma(-x) + num = sprintf("%.2f", x) # num is dddddd.dd + while (num ~ /[0-9][0-9][0-9][0-9]/) + sub(/[0-9][0-9][0-9][,.]/, ",&", num) + return num +} diff --git a/test/addcomma.in b/test/addcomma.in new file mode 100644 index 00000000..be70ac90 --- /dev/null +++ b/test/addcomma.in @@ -0,0 +1,7 @@ +0 +-1 +-12.34 +12345 +-1234567.89 +-123. +-123456 diff --git a/test/addcomma.ok b/test/addcomma.ok new file mode 100644 index 00000000..57c5886a --- /dev/null +++ b/test/addcomma.ok @@ -0,0 +1,7 @@ +0 0.00 +-1 -1.00 +-12.34 -12.34 +12345 12,345.00 +-1234567.89 -1,234,567.89 +-123. -123.00 +-123456 -123,456.00 diff --git a/test/arrayparm.ok b/test/arrayparm.ok index b315f7cf..4a775efe 100644 --- a/test/arrayparm.ok +++ b/test/arrayparm.ok @@ -1 +1 @@ -gawk: arrayparm.awk:18: fatal: attempt to use array `foo' in a scalar context +gawk: arrayparm.awk:18: fatal: attempt to use array `i (from foo)' in a scalar context diff --git a/test/arynasty.awk b/test/arynasty.awk new file mode 100644 index 00000000..ec170931 --- /dev/null +++ b/test/arynasty.awk @@ -0,0 +1,16 @@ +BEGIN { + a = 12.153 +#print "-- stroring test[a]" > "/dev/stderr" ; fflush("/dev/stderr") + test[a] = "hi" +#print "-- setting CONVFMT" > "/dev/stderr" ; fflush("/dev/stderr") + CONVFMT = "%.0f" +#print "-- setting a" > "/dev/stderr" ; fflush("/dev/stderr") + a = 5 +#stopme() +#print "-- starting loop" > "/dev/stderr" ; fflush("/dev/stderr") + for (i in test) { +#print("-- i =", i) > "/dev/stderr" ; fflush("/dev/stderr"); +#printf("-- i = <%s>\n", i) > "/dev/stderr" ; fflush("/dev/stderr"); + printf ("test[%s] = %s\n", i, test[i]) + } +} diff --git a/test/arynasty.ok b/test/arynasty.ok new file mode 100644 index 00000000..125ed80e --- /dev/null +++ b/test/arynasty.ok @@ -0,0 +1 @@ +test[12.153] = hi diff --git a/test/badargs.ok b/test/badargs.ok index 4913f0dd..b6f9cfea 100644 --- a/test/badargs.ok +++ b/test/badargs.ok @@ -1,6 +1,6 @@ gawk: option requires an argument -- f Usage: gawk [POSIX or GNU style options] -f progfile [--] file ... - gawk [POSIX or GNU style options] [--] 'program' file ... +Usage: gawk [POSIX or GNU style options] [--] 'program' file ... POSIX options: GNU long options: -f progfile --file=progfile -F fs --field-separator=fs @@ -9,9 +9,13 @@ POSIX options: GNU long options: -W compat --compat -W copyleft --copyleft -W copyright --copyright + -W dump-variables[=file] --dump-variables[=file] + -W gen-po --gen-po -W help --help - -W lint --lint + -W lint[=fatal] --lint[=fatal] -W lint-old --lint-old + -W non-decimal-data --non-decimal-data + -W profile[=file] --profile[=file] -W posix --posix -W re-interval --re-interval -W source=program-text --source=program-text @@ -19,6 +23,5 @@ POSIX options: GNU long options: -W usage --usage -W version --version -To report bugs, see node `Bugs' in `gawk.info', which -is section `Reporting Problems and Bugs' in the -printed version. +To report bugs, see node `Bugs' in `gawk.info', which is +section `Reporting Problems and Bugs' in the printed version. diff --git a/test/clos1way.awk b/test/clos1way.awk new file mode 100644 index 00000000..5bc40684 --- /dev/null +++ b/test/clos1way.awk @@ -0,0 +1,21 @@ +BEGIN { + command = "LC_ALL=C sort" + + n = split("abcdefghijklmnopqrstuvwxyz", a, "") + for (i = n; i > 0; i--) { +# print "printing", a[i] > "/dev/stderr" + print a[i] |& command + } + + close(command, "to") + +# print "starting read loop" > "/dev/stderr" + do { + if (line) + print "got", line +# stopme(); + } while ((command |& getline line) > 0) + +# print "doing final close" > "/dev/stderr" + close(command) +} diff --git a/test/clos1way.ok b/test/clos1way.ok new file mode 100644 index 00000000..09d732a6 --- /dev/null +++ b/test/clos1way.ok @@ -0,0 +1,26 @@ +got a +got b +got c +got d +got e +got f +got g +got h +got i +got j +got k +got l +got m +got n +got o +got p +got q +got r +got s +got t +got u +got v +got w +got x +got y +got z diff --git a/test/clsflnam.awk b/test/clsflnam.awk index 53928912..0ba601f0 100644 --- a/test/clsflnam.awk +++ b/test/clsflnam.awk @@ -4,7 +4,7 @@ BEGIN { # print ("FILENAME =", FILENAME) > "/dev/stderr" #Rewind the file if (close(FILENAME)) { - print "Error " ERRNO " closing input file" > "/dev/stderr"; + print "Error `" ERRNO "' closing input file" > "/dev/stderr"; exit; } } diff --git a/test/clsflnam.ok b/test/clsflnam.ok index e69de29b..9addfc78 100644 --- a/test/clsflnam.ok +++ b/test/clsflnam.ok @@ -0,0 +1 @@ +Error `close of redirection that was never opened' closing input file diff --git a/test/datanonl.awk b/test/datanonl.awk new file mode 100644 index 00000000..29e668e9 --- /dev/null +++ b/test/datanonl.awk @@ -0,0 +1,3 @@ +# example program from alex@bofh.torun.pl +BEGIN { IGNORECASE=1 } +/\w+@([[:alnum:]]+\.)+[[:alnum:]]+[[:blank:]]+/ {print $0} diff --git a/test/datanonl.in b/test/datanonl.in new file mode 100644 index 00000000..5340d7ba --- /dev/null +++ b/test/datanonl.in @@ -0,0 +1 @@ +bleble@foo1.bh.pl deny
\ No newline at end of file diff --git a/test/datanonl.ok b/test/datanonl.ok new file mode 100644 index 00000000..7b0fcafc --- /dev/null +++ b/test/datanonl.ok @@ -0,0 +1 @@ +bleble@foo1.bh.pl deny diff --git a/test/fnaryscl.awk b/test/fnaryscl.awk new file mode 100644 index 00000000..b88778ec --- /dev/null +++ b/test/fnaryscl.awk @@ -0,0 +1,10 @@ +BEGIN { + foo[1] = 4 + f1(foo) +} + +function f1(a) { f2(a) } + +function f2(b) { f3(b) } + +function f3(c) { c = 6 } diff --git a/test/fnaryscl.ok b/test/fnaryscl.ok new file mode 100644 index 00000000..d39dfdcc --- /dev/null +++ b/test/fnaryscl.ok @@ -0,0 +1 @@ +gawk: fnaryscl.awk:10: fatal: attempt to use array `c (from b (from a (from foo)))' in a scalar context diff --git a/test/fnasgnm.awk b/test/fnasgnm.awk new file mode 100644 index 00000000..056cdf7f --- /dev/null +++ b/test/fnasgnm.awk @@ -0,0 +1,14 @@ +# AFP_Bug1.awk - illustrate a problem with `gawk' (GNU Awk 3.0.3 on OS/2) +# Arthur Pool .. pool@commerce.uq.edu.au +# $Id: AFP_Bug1.awk,v 1.1 1998-03-17 12:22:44+10 pool Exp pool $ + +# Assignment to a variable with the same name as a function from within +# that function causes an ABEND. +# +# Yes, I do realise that it's not a smart thing to do, but an error +# message would be a kinder response than a core dump (and would make +# debugging a whole lot easier). + +{ShowMe()} + +function ShowMe() {ShowMe = 1} diff --git a/test/fnasgnm.in b/test/fnasgnm.in new file mode 100644 index 00000000..a9419310 --- /dev/null +++ b/test/fnasgnm.in @@ -0,0 +1 @@ +junk diff --git a/test/fnasgnm.ok b/test/fnasgnm.ok new file mode 100644 index 00000000..844893c0 --- /dev/null +++ b/test/fnasgnm.ok @@ -0,0 +1 @@ +gawk: fnasgnm.awk:14: (FILENAME=- FNR=1) fatal: can't use function name `ShowMe' as variable or array diff --git a/test/fsfwfs.awk b/test/fsfwfs.awk new file mode 100644 index 00000000..beed10a3 --- /dev/null +++ b/test/fsfwfs.awk @@ -0,0 +1 @@ +BEGIN{FIELDWIDTHS="6 6 6 5";OFS=",";FS=FS}{print $1,$2,$3,$4} diff --git a/test/fsfwfs.in b/test/fsfwfs.in new file mode 100644 index 00000000..fc109280 --- /dev/null +++ b/test/fsfwfs.in @@ -0,0 +1,16 @@ +00000113000 00000000000 +00000275000 00000000000 +00000321334 00000000000 +00000048709 00000010000 +00000117000 00000100000 +00000152000 00000138000 +00000000000 00000150000 +00000189425 00000000000 +00000146128 00000000000 +00000146128 00000000000 +00000146128 00000000000 +00000000000 00000050000 +00000000000 00000050000 +00000000000 00000000000 +00000158014 00000000000 +00000113656 00000000000 diff --git a/test/fsfwfs.ok b/test/fsfwfs.ok new file mode 100644 index 00000000..36bea48a --- /dev/null +++ b/test/fsfwfs.ok @@ -0,0 +1,16 @@ +00000113000,00000000000,, +00000275000,00000000000,, +00000321334,00000000000,, +00000048709,00000010000,, +00000117000,00000100000,, +00000152000,00000138000,, +00000000000,00000150000,, +00000189425,00000000000,, +00000146128,00000000000,, +00000146128,00000000000,, +00000146128,00000000000,, +00000000000,00000050000,, +00000000000,00000050000,, +00000000000,00000000000,, +00000158014,00000000000,, +00000113656,00000000000,, diff --git a/test/funsemnl.awk b/test/funsemnl.awk new file mode 100644 index 00000000..6b39dca5 --- /dev/null +++ b/test/funsemnl.awk @@ -0,0 +1,3 @@ +# make sure that ; + \n at end after function works +function foo() { print "foo" } ; +BEGIN { foo() } diff --git a/test/funsemnl.ok b/test/funsemnl.ok new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/test/funsemnl.ok @@ -0,0 +1 @@ +foo diff --git a/test/gnuops2.awk b/test/gnuops2.awk new file mode 100644 index 00000000..1b0d4d7f --- /dev/null +++ b/test/gnuops2.awk @@ -0,0 +1,72 @@ +# From Servatius.Brandt@fujitsu-siemens.com Fri Dec 1 13:44:48 2000 +# Received: from mail.actcom.co.il +# by localhost with POP3 (fetchmail-5.1.0) +# for arnold@localhost (single-drop); Fri, 01 Dec 2000 13:44:48 +0200 (IST) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Fri Dec 1 13:44:10 2000) +# X-From_: Servatius.Brandt@fujitsu-siemens.com Fri Dec 1 13:11:23 2000 +# Received: from lmail.actcom.co.il by actcom.co.il with ESMTP +# (8.9.1a/actcom-0.2) id NAA11033 for <arobbins@actcom.co.il>; +# Fri, 1 Dec 2000 13:11:21 +0200 (EET) +# (rfc931-sender: lmail.actcom.co.il [192.114.47.13]) +# Received: from billohost.com (10-209.196.35.dellhost.com [209.196.35.10] (may be forged)) +# by lmail.actcom.co.il (8.9.3/8.9.1) with ESMTP id NAA30286 +# for <arobbins@actcom.co.il>; Fri, 1 Dec 2000 13:12:25 +0200 +# Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) +# by billohost.com (8.9.3/8.9.3) with ESMTP id GAA26074 +# for <arnold@skeeve.com>; Fri, 1 Dec 2000 06:09:08 -0500 +# Received: from energy.pdb.sbs.de ([192.109.2.19]) +# by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) +# id 141o5z-0000RJ-00; Fri, 01 Dec 2000 06:11:16 -0500 +# Received: from trulli.pdb.fsc.net ([172.25.96.20]) +# by energy.pdb.sbs.de (8.9.3/8.9.3) with ESMTP id MAA32687; +# Fri, 1 Dec 2000 12:11:13 +0100 +# Received: from pdbrd02e.pdb.fsc.net (pdbrd02e.pdb.fsc.net [172.25.96.15]) +# by trulli.pdb.fsc.net (8.9.3/8.9.3) with ESMTP id MAA27384; +# Fri, 1 Dec 2000 12:11:13 +0100 +# Received: from Fujitsu-Siemens.com (pgtd1181.mch.fsc.net [172.25.126.152]) by pdbrd02e.pdb.fsc.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) +# id XC2QLXS2; Fri, 1 Dec 2000 12:11:13 +0100 +# Message-ID: <3A2786CF.1000903@Fujitsu-Siemens.com> +# Date: Fri, 01 Dec 2000 12:09:03 +0100 +# From: Servatius Brandt <Servatius.Brandt@fujitsu-siemens.com> +# Organization: Fujitsu Siemens Computers +# User-Agent: Mozilla/5.0 (Windows; U; Win95; en-US; m18) Gecko/20001108 Netscape6/6.0 +# X-Accept-Language: de, en +# MIME-Version: 1.0 +# To: bug-gnu-utils@gnu.org +# CC: arnold@gnu.org +# Subject: Bug Report: \y, \B, \<, \> do not work with _ +# Content-Type: text/plain; charset=us-ascii; format=flowed +# Content-Transfer-Encoding: 7bit +# Status: R +# +# Hello, +# +# The \y, \B, \<, \> patterns do not regard _ as +# word-constituent (unlike \w and \W, which do). +# +# Operating system: ReliantUNIX-Y 5.44 C2001 RM600 R10000 +# Version of gawk: 3.0.6 +# C-Compiler: Fujitsu Siemens Computers CDS++ V2.0C0004 +# +# Test program: +# +#!/usr/local/bin/gawk -f + +BEGIN { + print match("X _abc Y", /\<_abc/) # bug + print match("X _abc Y", /\y_abc/) # bug + print match("X abc_ Y", /abc_\>/) # bug + print match("X abc_ Y", /abc_\y/) # bug + print match("X abc_def Y", /abc_\Bdef/) # bug + + print match("X a_c Y", /a\wc/) # ok! + print match("X a.c Y", /a\Wc/) # ok! + exit +} +# +# +# Regards, +# Servatius Brandt +# +# diff --git a/test/gnuops2.ok b/test/gnuops2.ok new file mode 100644 index 00000000..aa0ecae5 --- /dev/null +++ b/test/gnuops2.ok @@ -0,0 +1,7 @@ +3 +3 +3 +3 +3 +3 +3 diff --git a/test/gsubtest.awk b/test/gsubtest.awk index 5dfefe93..5dfefe93 100755..100644 --- a/test/gsubtest.awk +++ b/test/gsubtest.awk diff --git a/test/hsprint.awk b/test/hsprint.awk new file mode 100644 index 00000000..d17cedeb --- /dev/null +++ b/test/hsprint.awk @@ -0,0 +1,74 @@ +# Test which attempts to repeat examples of formatted output +# from "C a reference manual" by Harbison and Steele. +# +# In the second series of outputs formats of a type "%5%" are skipped +# since my old copy of H&S explicitely requires padding ("...%05% will +# print 0000%..."), whereas Standard says "...the complete conversion +# specification shall be %%". +# +# Michal Jaegermann - michal@phys.ualberta.ca + + +BEGIN { + zero = "0"; + alt = "#"; + spc = " "; + plus = "+"; + just = "-"; + value[0] = 45; + value[1] = 45; + value[2] = 45; + value[3] = 12.678; + value[4] = 12.678; + value[5] = 12.678; + value[6] = "zap"; + value[7] = "*"; + value[8] = -3.4567; + value[9] = -3.4567; + value[10]= -3.4567; + value[11]= -3.4567; + oper[0] = "5d"; + oper[1] = "5o"; + oper[2] = "5x"; + oper[3] = "7.2f"; + oper[4] = "10.2e"; + oper[5] = "10.4g"; + oper[6] = "5s"; + oper[7] = "5c"; + oper[8] = "7.1G"; + oper[9] = "7.2f"; + oper[10] = "10.2e"; + oper[11] = "10.4g"; + + + for (r = 0; r < 12; r += 6) { + for (j = 2; j > 0; --j) { + for (p = 2; p > 0; --p) { + for (s = 2; s > 0; --s) { + for (a = 2; a > 0; --a) { + for (z = 2; z > 0; --z) { + fmt = "%" substr(just,j,1) substr(plus,p,1) \ + substr(spc,s,1) substr(alt,a,1) substr(zero,z,1); + fstr = sprintf(\ + "%6s|%s%s|%s%s|%s%s|%s%s|%s%s|%s%s|\n", + fmt, + fmt, oper[r], + fmt, oper[r+1], + fmt, oper[r+2], + fmt, oper[r+3], + fmt, oper[r+4], + fmt, oper[r+5]); + printf(fstr, value[r], value[r+1], + value[r+2], value[r+3], + value[r+4], value[r+5]); + } + } + } + } + } + print ""; + } +} + + + diff --git a/test/hsprint.ok b/test/hsprint.ok new file mode 100644 index 00000000..55fd16f3 --- /dev/null +++ b/test/hsprint.ok @@ -0,0 +1,66 @@ + %| 45| 55| 2d| 12.68| 1.27e+01| 12.68| + %0|00045|00055|0002d|0012.68|001.27e+01|0000012.68| + %#| 45| 055| 0x2d| 12.68| 1.27e+01| 12.68| + %#0|00045|00055|0x02d|0012.68|001.27e+01|0000012.68| + % | 45| 55| 2d| 12.68| 1.27e+01| 12.68| + % 0| 0045|00055|0002d| 012.68| 01.27e+01| 000012.68| + % #| 45| 055| 0x2d| 12.68| 1.27e+01| 12.68| + % #0| 0045|00055|0x02d| 012.68| 01.27e+01| 000012.68| + %+| +45| 55| 2d| +12.68| +1.27e+01| +12.68| + %+0|+0045|00055|0002d|+012.68|+01.27e+01|+000012.68| + %+#| +45| 055| 0x2d| +12.68| +1.27e+01| +12.68| + %+#0|+0045|00055|0x02d|+012.68|+01.27e+01|+000012.68| + %+ | +45| 55| 2d| +12.68| +1.27e+01| +12.68| + %+ 0|+0045|00055|0002d|+012.68|+01.27e+01|+000012.68| + %+ #| +45| 055| 0x2d| +12.68| +1.27e+01| +12.68| + %+ #0|+0045|00055|0x02d|+012.68|+01.27e+01|+000012.68| + %-|45 |55 |2d |12.68 |1.27e+01 |12.68 | + %-0|45 |55 |2d |12.68 |1.27e+01 |12.68 | + %-#|45 |055 |0x2d |12.68 |1.27e+01 |12.68 | + %-#0|45 |055 |0x2d |12.68 |1.27e+01 |12.68 | + %- | 45 |55 |2d | 12.68 | 1.27e+01 | 12.68 | + %- 0| 45 |55 |2d | 12.68 | 1.27e+01 | 12.68 | + %- #| 45 |055 |0x2d | 12.68 | 1.27e+01 | 12.68 | + %- #0| 45 |055 |0x2d | 12.68 | 1.27e+01 | 12.68 | + %-+|+45 |55 |2d |+12.68 |+1.27e+01 |+12.68 | + %-+0|+45 |55 |2d |+12.68 |+1.27e+01 |+12.68 | + %-+#|+45 |055 |0x2d |+12.68 |+1.27e+01 |+12.68 | + %-+#0|+45 |055 |0x2d |+12.68 |+1.27e+01 |+12.68 | + %-+ |+45 |55 |2d |+12.68 |+1.27e+01 |+12.68 | + %-+ 0|+45 |55 |2d |+12.68 |+1.27e+01 |+12.68 | + %-+ #|+45 |055 |0x2d |+12.68 |+1.27e+01 |+12.68 | +%-+ #0|+45 |055 |0x2d |+12.68 |+1.27e+01 |+12.68 | + + %| zap| *| -3| -3.46| -3.46e+00| -3.457| + %0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| + %#| zap| *| -3.| -3.46| -3.46e+00| -3.457| + %#0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| + % | zap| *| -3| -3.46| -3.46e+00| -3.457| + % 0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| + % #| zap| *| -3.| -3.46| -3.46e+00| -3.457| + % #0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| + %+| zap| *| -3| -3.46| -3.46e+00| -3.457| + %+0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| + %+#| zap| *| -3.| -3.46| -3.46e+00| -3.457| + %+#0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| + %+ | zap| *| -3| -3.46| -3.46e+00| -3.457| + %+ 0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| + %+ #| zap| *| -3.| -3.46| -3.46e+00| -3.457| + %+ #0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| + %-|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | + %-0|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | + %-#|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | + %-#0|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | + %- |zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | + %- 0|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | + %- #|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | + %- #0|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | + %-+|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | + %-+0|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | + %-+#|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | + %-+#0|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | + %-+ |zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | + %-+ 0|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | + %-+ #|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | +%-+ #0|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | + diff --git a/test/inftest.awk b/test/inftest.awk index ec0eda13..f24bd7e3 100644 --- a/test/inftest.awk +++ b/test/inftest.awk @@ -1,5 +1,5 @@ BEGIN { x = 100 - do { y = x ; x *= 1000; print x,y } while ( y != x ) + do { y = x ; x *= 1000; print x,y } while ( y < x ) print "loop terminated" } diff --git a/test/leaddig.awk b/test/leaddig.awk new file mode 100644 index 00000000..6c001ba6 --- /dev/null +++ b/test/leaddig.awk @@ -0,0 +1,7 @@ +# check that values with leading digits get converted the +# right way, based on a note in comp.lang.awk. +# +# run with gawk -v x=2E -f leaddig.awk +BEGIN { + print "x =", x, (x == 2), (x == 2E0), (x == 2E), (x == 2D) +} diff --git a/test/leaddig.ok b/test/leaddig.ok new file mode 100644 index 00000000..7a9d866e --- /dev/null +++ b/test/leaddig.ok @@ -0,0 +1 @@ +x = 2E 0 0 0 0 diff --git a/test/leadnl.awk b/test/leadnl.awk new file mode 100644 index 00000000..0b7d0a97 --- /dev/null +++ b/test/leadnl.awk @@ -0,0 +1,10 @@ +BEGIN { + RS = ""; FS = "\n" +} + +{ + print "Name is: ", $1 + print "Address is: ", $2 + print "City and State are: ", $3 + print "" +} diff --git a/test/leadnl.in b/test/leadnl.in new file mode 100644 index 00000000..67c0239b --- /dev/null +++ b/test/leadnl.in @@ -0,0 +1,9 @@ + +Jane Doe +123 Main Street +Anywhere, SE 12345-6789 + +John Smith +456 Tree-lined Avenue +Smallville, MW 98765-4321 + diff --git a/test/leadnl.ok b/test/leadnl.ok new file mode 100644 index 00000000..19cb2992 --- /dev/null +++ b/test/leadnl.ok @@ -0,0 +1,8 @@ +Name is: Jane Doe +Address is: 123 Main Street +City and State are: Anywhere, SE 12345-6789 + +Name is: John Smith +Address is: 456 Tree-lined Avenue +City and State are: Smallville, MW 98765-4321 + diff --git a/test/lint.awk b/test/lint.awk new file mode 100644 index 00000000..ea7b8e38 --- /dev/null +++ b/test/lint.awk @@ -0,0 +1,14 @@ +# lint.awk --- test lint variable + +BEGIN { + a[1] = 1 + LINT = 1 + delete a[2] + LINT = "" + delete a[3] + LINT = "true" + delete a[4] + LINT = 0 + delete a[5] + print "done" +} diff --git a/test/lint.ok b/test/lint.ok new file mode 100644 index 00000000..ec24d831 --- /dev/null +++ b/test/lint.ok @@ -0,0 +1,5 @@ +gawk: lint.awk:7: warning: delete: index `2' not in array `a' +gawk: lint.awk:7: warning: turning off `--lint' due to assignment to `LINT' +gawk: lint.awk:11: warning: delete: index `4' not in array `a' +gawk: lint.awk:11: warning: turning off `--lint' due to assignment to `LINT' +done diff --git a/test/nasty.ok b/test/nasty.ok index 5189cf81..0ee1a73b 100644 --- a/test/nasty.ok +++ b/test/nasty.ok @@ -1,2 +1,2 @@ -123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123 +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa X diff --git a/test/nasty2.awk b/test/nasty2.awk new file mode 100644 index 00000000..cb0bd6d3 --- /dev/null +++ b/test/nasty2.awk @@ -0,0 +1,20 @@ +# Based on nasty.awk, test same thing for printf +# +BEGIN { +a="aaaaa" +a=a a #10 +a=a a #20 +a=a a #40 +a=a a #80 +a=a a #160 +a=a a # i.e. a is long enough + +printf("a = %s, f() = %s\n", a, f()) +print a +} + +function f() +{ +gsub(/a/, "123", a) +return "X" +} diff --git a/test/nasty2.ok b/test/nasty2.ok new file mode 100644 index 00000000..9b62bf08 --- /dev/null +++ b/test/nasty2.ok @@ -0,0 +1,2 @@ +a = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, f() = X +123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123 diff --git a/test/nlinstr.awk b/test/nlinstr.awk new file mode 100644 index 00000000..f403715c --- /dev/null +++ b/test/nlinstr.awk @@ -0,0 +1,8 @@ +BEGIN { RS = "" } + +{ + if (/^@/) + print "not ok" + else + print "ok" +} diff --git a/test/nlinstr.in b/test/nlinstr.in new file mode 100644 index 00000000..65aaaf9e --- /dev/null +++ b/test/nlinstr.in @@ -0,0 +1,2 @@ +line 1 +@line 2 diff --git a/test/nlinstr.ok b/test/nlinstr.ok new file mode 100644 index 00000000..9766475a --- /dev/null +++ b/test/nlinstr.ok @@ -0,0 +1 @@ +ok diff --git a/test/noeffect.ok b/test/noeffect.ok index b820ddf8..792ff66a 100644 --- a/test/noeffect.ok +++ b/test/noeffect.ok @@ -1,2 +1,4 @@ gawk: noeffect.awk:3: warning: statement may have no effect +gawk: noeffect.awk:2: warning: reference to uninitialized variable `s' +gawk: noeffect.awk:4: warning: reference to uninitialized variable `s' diff --git a/test/nofmtch.ok b/test/nofmtch.ok index e6f3846f..297d1592 100644 --- a/test/nofmtch.ok +++ b/test/nofmtch.ok @@ -1,2 +1,2 @@ -gawk: nofmtch.awk:1: warning: printf format specifier does not have control letter +gawk: nofmtch.awk:1: warning: [s]printf: format specifier does not have control letter %3 diff --git a/test/octsub.awk b/test/octsub.awk new file mode 100644 index 00000000..65e96897 --- /dev/null +++ b/test/octsub.awk @@ -0,0 +1 @@ +BEGIN{ ++x[03]; print "/" x[0] "/" x[3] "/"} diff --git a/test/octsub.ok b/test/octsub.ok new file mode 100644 index 00000000..95cbdc77 --- /dev/null +++ b/test/octsub.ok @@ -0,0 +1 @@ +//1/ diff --git a/test/ofmt.awk b/test/ofmt.awk new file mode 100644 index 00000000..a7b63d63 --- /dev/null +++ b/test/ofmt.awk @@ -0,0 +1,53 @@ +# From dragon!knorke.saar.de!florian Wed Jul 16 10:47:27 1997 +# Return-Path: <dragon!knorke.saar.de!florian> +# Message-ID: <19970716164451.63610@knorke.saar.de> +# Date: Wed, 16 Jul 1997 16:44:51 +0200 +# From: Florian La Roche <florian@knorke.saar.de> +# To: bug-gnu-utils@prep.ai.mit.edu +# CC: arnold@gnu.ai.mit.edu +# Subject: bug in gawk 3.0.3 +# MIME-Version: 1.0 +# Content-Type: text/plain; charset=us-ascii +# X-Mailer: Mutt 0.76 +# Status: R +# Content-Length: 1725 +# X-Lines: 177 +# X-Display-Position: 0 +# +# I have a problem with gawk 3.0.3 on linux with libc 5.4.33. +# The memory is corrupted, if I use OFMT = "%.12g". +# With OFMT = "%.6g" evrything works fine, but I don't have enough +# digits for the computation. +# +# Thanks a lot, +# Florian La Roche +# +# Here is the sample awk-Script together with sample data: +# +BEGIN { + OFMT = "%.12g" + big = 99999999999 + lowest = big + small = 0 + highest = small + dir = "" + } +$0 ~ /^[0-9]+$/ { + # some old awks do not think $0 is numeric, so use $1 + if ($1 < lowest) + lowest = $1 + if ($1 > highest) + highest = $1 + next +} +$0 ~ /\/\.:$/ { + if (dir != "") { + if (highest != small) + print dir, highest, lowest + else + print dir, "-", "-" + } + dir = substr($0, 1, length($0)-3) # trim off /.: + lowest = big + highest = small +} diff --git a/test/ofmt.in b/test/ofmt.in new file mode 100644 index 00000000..6fffdfee --- /dev/null +++ b/test/ofmt.in @@ -0,0 +1,136 @@ +alt/binaries/warez/crypto/.: +.. +... + +alt/fan/douglas-adams/.: +.. +... +7478 +7479 +7480 +7481 +7482 +7483 +7484 +7485 +7486 +7490 +7488 +7489 +7491 +7407 +7408 +7409 +7410 +7411 +7412 +7413 +7414 +7415 +7416 +7417 +7418 +7419 +7420 +7421 +7422 +7423 +7424 +7425 +7426 +7427 +7428 +7429 +7430 +7431 +7432 +7433 +7434 +7435 +7436 +7437 +7438 +7439 +7440 +7441 +7442 +7443 +7444 +7445 +7446 +7447 +7455 +7449 +7450 +7451 +7452 +7453 +7454 +7456 +7457 +7458 +7459 +7460 +7461 +7462 +7463 +7464 +7465 +7466 +7467 +7468 +7469 +7470 +7471 +7472 +7473 +7475 +7477 + +alt/os/linux/.: +.. +... + + +alt/security/.: +.. +... +pgp +ripem +keydist +index +9617 +9618 +9619 +9620 +9625 +9621 +9626 +9622 +9623 +9624 +9627 +9628 +9629 +9630 +9631 +9632 +9633 +9634 +9636 +9637 +9638 +9639 +9640 +9641 + +alt/security/index/.: +.. +... + +alt/security/keydist/.: +.. +... +253 + +/.: diff --git a/test/ofmt.ok b/test/ofmt.ok new file mode 100644 index 00000000..389c1ef8 --- /dev/null +++ b/test/ofmt.ok @@ -0,0 +1,6 @@ +alt/binaries/warez/crypto - - +alt/fan/douglas-adams 7491 7407 +alt/os/linux - - +alt/security 9641 9617 +alt/security/index - - +alt/security/keydist 253 253 diff --git a/test/ofmtbig.awk b/test/ofmtbig.awk new file mode 100644 index 00000000..f1b23849 --- /dev/null +++ b/test/ofmtbig.awk @@ -0,0 +1,125 @@ +# +# [USEMAP] +# +# Problem Report gnu/7821 +# +# awk in free(): warning: chunk is already free. +# +# Confidential +# no +# +# Severity +# serious +# +# Priority +# medium +# +# Responsible +# freebsd-bugs@freebsd.org +# +# State +# suspended +# +# Class +# sw-bug +# +# Submitter-Id +# current-users +# +# Arrival-Date +# Thu Sep 3 10:30:00 PDT 1998 +# +# Last-Modified +# Thu Sep 17 02:04:26 PDT 1998 +# +# Originator +# Alexander Litvin archer@lucky.net +# +# Organization +# +# +#Lucky Net ltd. +# +# Release +# FreeBSD 3.0-CURRENT i386 +# +# Environment +# +# +#FreeBSD grape.carrier.kiev.ua 3.0-CURRENT FreeBSD 3.0-CURRENT #121: Thu Sep 3 +#1 +#1:21:44 EEST 1998 archer@grape.carrier.kiev.ua:/usr/src/sys/compile/GRAPE +#i +#386 +# +# Description +# +# +#The problem first appeared when GNU awk in 3.0-CURRENT was apgraded to +#3.0.3. I run C-News, which uses awk extensively. After awk apgrade C-News +#expire stopped to work. It appeared that some GNU awk 3.0.3 programms when +#given absolutely legitimate input fail, giving out a number of messages: +# +#awk in free(): warning: chunk is already free. +# +# How-To-Repeat +# +# +#Run the following awk program (it is cut out of C-News expire scripts). +#I was not able to cut it down more -- omitting some portions of the +#code (e.g. OFMT line), make error go away in this case, though it +#certainly does not fix awk. +# +#----------------cut-here---------------- +#!/usr/bin/awk -f +BEGIN { + OFMT = "%.12g" + big = 99999999999 + lowest = big + small = 0 + highest = small +} + +$0 ~ /^[0-9]+$/ { + if ($1 < lowest) + lowest = $1 + if ($1 > highest) + highest = $1 + next +} + +$0 ~ /^[a-z]+/ { + print dir, highest, lowest + dir = $0 + lowest = big + highest = small +} +#----------------cut-here---------------- +# +#To get the error, just give this script the following input: +#----------------cut-here---------------- +#a +#1 +#b +#----------------cut-here---------------- +# +# Fix +# +# +#I was not able to track the error in awk sources. As a workaround, +#I just reverted to GNU awk 2.15.5. +# +# Audit-Trail +# +# +#State-Changed-From-To: open-suspended +#State-Changed-By: phk +#State-Changed-When: Thu Sep 17 02:04:08 PDT 1998 +#State-Changed-Why: +#reported to GNU maintainer. +# +# Submit Followup +# _________________________________________________________________ +# +# +# www@freebsd.org diff --git a/test/ofmtbig.in b/test/ofmtbig.in new file mode 100644 index 00000000..f1e80ce4 --- /dev/null +++ b/test/ofmtbig.in @@ -0,0 +1,3 @@ +a +1 +b diff --git a/test/ofmtbig.ok b/test/ofmtbig.ok new file mode 100644 index 00000000..0fe9251d --- /dev/null +++ b/test/ofmtbig.ok @@ -0,0 +1,2 @@ + 0 99999999999 +a 1 1 diff --git a/test/ofmts.awk b/test/ofmts.awk new file mode 100644 index 00000000..6ee37054 --- /dev/null +++ b/test/ofmts.awk @@ -0,0 +1,2 @@ +BEGIN { OFMT= "%s" } +{ $1 + $2; print $1, $2 } diff --git a/test/ofmts.in b/test/ofmts.in new file mode 100644 index 00000000..50c37ec7 --- /dev/null +++ b/test/ofmts.in @@ -0,0 +1 @@ +1.2 2.2 diff --git a/test/ofmts.ok b/test/ofmts.ok new file mode 100644 index 00000000..50c37ec7 --- /dev/null +++ b/test/ofmts.ok @@ -0,0 +1 @@ +1.2 2.2 diff --git a/test/paramtyp.awk b/test/paramtyp.awk new file mode 100644 index 00000000..58848bbf --- /dev/null +++ b/test/paramtyp.awk @@ -0,0 +1,20 @@ +# Sun Apr 25 13:28:58 IDT 1999 +# from Juegen Khars. This program should not core dump. + function ReadPGM(f, d) { +print "ReadPGM" + d[1] = 1 + } + + function WritePGM(f, d) { +print "WritePGM" + d[1] = 0 + } + + BEGIN { +print "before ReadPGM" + ReadPGM("", d) +print "after ReadPGM" +print "before WritePGM" + WritePGM("", d) +print "after WritePGM" + } diff --git a/test/paramtyp.ok b/test/paramtyp.ok new file mode 100644 index 00000000..793f857a --- /dev/null +++ b/test/paramtyp.ok @@ -0,0 +1,6 @@ +before ReadPGM +ReadPGM +after ReadPGM +before WritePGM +WritePGM +after WritePGM diff --git a/test/parseme.awk b/test/parseme.awk new file mode 100644 index 00000000..4d6ba943 --- /dev/null +++ b/test/parseme.awk @@ -0,0 +1 @@ +BEGIN { toupper(substr*line,1,12)) } diff --git a/test/parseme.ok b/test/parseme.ok new file mode 100644 index 00000000..f08fee66 --- /dev/null +++ b/test/parseme.ok @@ -0,0 +1,3 @@ +gawk: parseme.awk:1: BEGIN { toupper(substr*line,1,12)) } +gawk: parseme.awk:1: ^ parse error +gawk: parseme.awk:1: fatal: 0 is invalid as number of arguments for toupper diff --git a/test/pid.sh b/test/pid.sh index a19d72ce..901637ad 100755 --- a/test/pid.sh +++ b/test/pid.sh @@ -2,4 +2,4 @@ AWK=${AWK-../gawk} echo $$ > _pid.in echo $1 >> _pid.in -exec $AWK -f pid.awk _pid.in +exec $AWK -f pid.awk _pid.in 2>/dev/null diff --git a/test/pipeio2.awk b/test/pipeio2.awk index a1fdd5dd..32d09eee 100644 --- a/test/pipeio2.awk +++ b/test/pipeio2.awk @@ -29,7 +29,8 @@ BEGIN { # com_tr = "echo " fnam " | tr [0-9]. ..........." com_tr = "echo " fnam " | sed 's/[0-9]/./g'" - print "\'" com_tr "\'" + # print "\'" com_tr "\'" + print "'" com_tr "'" com_tr | getline nam print nam diff --git a/test/poundbang b/test/poundbang.awk index d60652e3..d60652e3 100755 --- a/test/poundbang +++ b/test/poundbang.awk diff --git a/test/printfloat.awk b/test/printfloat.awk new file mode 100644 index 00000000..1cb40660 --- /dev/null +++ b/test/printfloat.awk @@ -0,0 +1,62 @@ +# Test program for checking sprintf operation with various floating +# point formats +# +# Watch out - full output of this program will have 3000 * tot lines, +# which will take a chunk of space if you will write it to your disk. +# --mj + +BEGIN { + just = "-" + plus = "+ " + alt = "#" + zero = "0" + spec = "feEgG" + fw[1] = "" + fw[2] = "1" + fw[3] = "5" + fw[4] = "10" + fw[5] = "15" + prec[1] = ".-1" + prec[2] = "" + prec[3] = ".2" + prec[4] = ".5" + prec[5] = ".10" + + num = 123.6 + factor = 1.0e-12 + tot = 8 + data[1] = 0 + data[2] = 1 + for (i = 3; i <= tot; i++) { + data[i] = num * factor + factor *= 1000 + } + + for (j = 1; j <= 2; j++) { + for (p = 1; p <= 3; p++) { + for (a = 1; a <= 2; a++) { + for (z = 1; z <= 2; z++) { + for (s = 1; s <= 5; s++) { + for (w = 1; w <= 5; w++) { + for (r = 1; r <= 5; r++) { + frmt = "|%" substr(just, j, 1) + frmt = frmt substr(plus, p, 1) + frmt = frmt substr(alt, a, 1) + frmt = frmt substr(zero, z, 1) + frmt = frmt fw[w] prec[r] + frmt = frmt substr(spec, s, 1) "|" + for (i = 1; i <= tot; i++) { + result = sprintf(frmt, data[i]) +# "normalize" if you must +# sub(/\|\./, "|0.", result) + printf("%-16s %-25s\t%g\n", frmt, + result,data[i]) + } + } + } + } + } + } + } + } +} diff --git a/test/prmarscl.ok b/test/prmarscl.ok index b42cee67..41784fdc 100644 --- a/test/prmarscl.ok +++ b/test/prmarscl.ok @@ -1 +1 @@ -gawk: prmarscl.awk:4: fatal: attempt to use scalar parameter 1 as an array +gawk: prmarscl.awk:4: fatal: attempt to use scalar parameter `a' as an array diff --git a/test/procinfs.awk b/test/procinfs.awk new file mode 100644 index 00000000..53cfa977 --- /dev/null +++ b/test/procinfs.awk @@ -0,0 +1,7 @@ +BEGIN { + printf "Initially, PROCINFO[\"FS\"] = %s\n", PROCINFO["FS"] + FIELDWIDTHS = "3 4 5 6" + printf "After assign to FIELDWIDTHS, PROCINFO[\"FS\"] = %s\n", PROCINFO["FS"] + FS = FS + printf "After assign to FS, PROCINFO[\"FS\"] = %s\n", PROCINFO["FS"] +} diff --git a/test/procinfs.ok b/test/procinfs.ok new file mode 100644 index 00000000..23aaeff0 --- /dev/null +++ b/test/procinfs.ok @@ -0,0 +1,3 @@ +Initially, PROCINFO["FS"] = FS +After assign to FIELDWIDTHS, PROCINFO["FS"] = FIELDWIDTHS +After assign to FS, PROCINFO["FS"] = FS diff --git a/test/psx96sub.awk b/test/psx96sub.awk new file mode 100644 index 00000000..3c7c9b77 --- /dev/null +++ b/test/psx96sub.awk @@ -0,0 +1,7 @@ +BEGIN { + text = "here is some text" + repl = "<FOO&BAR \\q \\ \\\\ \\& \\\\& \\\\\\&>" + printf "orig = \"%s\", repl = \"%s\"\n", text, repl + sub(/some/, repl, text) + printf "result is \"%s\"\n", text +} diff --git a/test/psx96sub.ok b/test/psx96sub.ok new file mode 100644 index 00000000..d6b89ee4 --- /dev/null +++ b/test/psx96sub.ok @@ -0,0 +1,2 @@ +orig = "here is some text", repl = "<FOO&BAR \q \ \\ \& \\& \\\&>" +result is "here is <FOOsomeBAR \q \ \\ & \some \&> text" diff --git a/test/rand.ok b/test/rand.ok index b6d75545..60432b95 100644 --- a/test/rand.ok +++ b/test/rand.ok @@ -1 +1 @@ - 27 17 86 27 22 53 61 11 33 48 51 97 99 35 20 27 62 100 32 + 62 67 88 6 35 77 3 68 30 96 90 26 35 8 88 93 49 53 37 diff --git a/test/rebt8b1.awk b/test/rebt8b1.awk new file mode 100644 index 00000000..8fa43fba --- /dev/null +++ b/test/rebt8b1.awk @@ -0,0 +1,138 @@ +# From hankedr@dms.auburn.edu Sun Jan 28 12:25:43 2001 +# Received: from mail.actcom.co.il [192.114.47.13] +# by localhost with POP3 (fetchmail-5.5.0) +# for arnold@localhost (single-drop); Sun, 28 Jan 2001 12:25:43 +0200 (IST) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Sun Jan 28 12:27:08 2001) +# X-From_: hankedr@dms.auburn.edu Sat Jan 27 15:15:57 2001 +# Received: from lmail.actcom.co.il by actcom.co.il with ESMTP +# (8.9.1a/actcom-0.2) id PAA23801 for <arobbins@actcom.co.il>; +# Sat, 27 Jan 2001 15:15:55 +0200 (EET) +# (rfc931-sender: lmail.actcom.co.il [192.114.47.13]) +# Received: from billohost.com (www.billohost.com [209.196.35.10]) +# by lmail.actcom.co.il (8.9.3/8.9.1) with ESMTP id PAA15998 +# for <arobbins@actcom.co.il>; Sat, 27 Jan 2001 15:16:27 +0200 +# Received: from yak.dms.auburn.edu (yak.dms.auburn.edu [131.204.53.2]) +# by billohost.com (8.9.3/8.9.3) with ESMTP id IAA00467 +# for <arnold@skeeve.com>; Sat, 27 Jan 2001 08:15:52 -0500 +# Received: (from hankedr@localhost) +# by yak.dms.auburn.edu (8.9.3/8.9.3/Debian/GNU) id HAA24441; +# Sat, 27 Jan 2001 07:15:44 -0600 +# Date: Sat, 27 Jan 2001 07:15:44 -0600 +# Message-Id: <200101271315.HAA24441@yak.dms.auburn.edu> +# From: Darrel Hankerson <hankedr@dms.auburn.edu> +# To: arnold@skeeve.com +# Subject: [stolfi@ic.unicamp.br: Bug in [...]* matching with acute-u] +# Mime-Version: 1.0 (generated by tm-edit 7.106) +# Content-Type: message/rfc822 +# Status: R +# +# From: Jorge Stolfi <stolfi@ic.unicamp.br> +# To: bug-gnu-utils@gnu.org +# Subject: Bug in [...]* matching with acute-u +# MIME-Version: 1.0 +# Reply-To: stolfi@ic.unicamp.br +# X-MIME-Autoconverted: from 8bit to quoted-printable by grande.dcc.unicamp.br id GAA10716 +# Sender: bug-gnu-utils-admin@gnu.org +# Errors-To: bug-gnu-utils-admin@gnu.org +# X-BeenThere: bug-gnu-utils@gnu.org +# X-Mailman-Version: 2.0 +# Precedence: bulk +# List-Help: <mailto:bug-gnu-utils-request@gnu.org?subject=help> +# List-Post: <mailto:bug-gnu-utils@gnu.org> +# List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-gnu-utils>, +# <mailto:bug-gnu-utils-request@gnu.org?subject=subscribe> +# List-Id: Bug reports for the GNU utilities <bug-gnu-utils.gnu.org> +# List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-gnu-utils>, +# <mailto:bug-gnu-utils-request@gnu.org?subject=unsubscribe> +# List-Archive: <http://mail.gnu.org/pipermail/bug-gnu-utils/> +# Date: Sat, 27 Jan 2001 06:46:11 -0200 (EDT) +# Content-Transfer-Encoding: 8bit +# X-MIME-Autoconverted: from quoted-printable to 8bit by manatee.dms.auburn.edu id CAA14936 +# Content-Type: text/plain; charset=iso-8859-1 +# <mailto:bug-gnu-utils-request@gnu.org?subject=subscribe> +# <mailto:bug-gnu-utils-request@gnu.org?subject=uns +# Content-Length: 3137 +# +# +# +# Hi, +# +# I think I have run into a bug in gawk's handling of REs of the +# form [...]* when the bracketed list includes certain 8-bit characters, +# specifically u-acute (octal \372). +# +# The problem occurs in GNU Awk 3.0.4, both under +# Linux 2.2.14-5.0 (intel i686) and SunOS 5.5 (Sun sparc). +# +# Here is a program that illustrates the bug, and its output. +# The first two lines of the output should be equal, shouldn't they? +# +# ---------------------------------------------------------------------- +#! /usr/bin/gawk -f + +BEGIN { + s = "bananas and ananases in canaan"; + t = s; gsub(/[an]*n/, "AN", t); printf "%-8s %s\n", "[an]*n", t; + t = s; gsub(/[anú]*n/, "AN", t); printf "%-8s %s\n", "[anú]*n", t; + print ""; + t = s; gsub(/[aú]*n/, "AN", t); printf "%-8s %s\n", "[aú]*n", t; + print ""; + t = s; gsub(/[an]n/, "AN", t); printf "%-8s %s\n", "[an]n", t; + t = s; gsub(/[aú]n/, "AN", t); printf "%-8s %s\n", "[aú]n", t; + t = s; gsub(/[anú]n/, "AN", t); printf "%-8s %s\n", "[anú]n", t; + print ""; + t = s; gsub(/[an]?n/, "AN", t); printf "%-8s %s\n", "[an]?n", t; + t = s; gsub(/[aú]?n/, "AN", t); printf "%-8s %s\n", "[aú]?n", t; + t = s; gsub(/[anú]?n/, "AN", t); printf "%-8s %s\n", "[anú]?n", t; + print ""; + t = s; gsub(/[an]+n/, "AN", t); printf "%-8s %s\n", "[an]+n", t; + t = s; gsub(/[aú]+n/, "AN", t); printf "%-8s %s\n", "[aú]+n", t; + t = s; gsub(/[anú]+n/, "AN", t); printf "%-8s %s\n", "[anú]+n", t; +} +# ---------------------------------------------------------------------- +# [an]*n bANas ANd ANases iAN cAN +# [anú]*n bananas and ananases in canaan +# +# [aú]*n bANANas ANd ANANases iAN cANAN +# +# [an]n bANANas ANd ANANases in cANaAN +# [aú]n bANANas ANd ANANases in cANaAN +# [anú]n bANANas ANd ANANases in cANaAN +# +# [an]?n bANANas ANd ANANases iAN cANaAN +# [aú]?n bANANas ANd ANANases iAN cANaAN +# [anú]?n bANANas ANd ANANases iAN cANaAN +# +# [an]+n bANas ANd ANases in cAN +# [aú]+n bANANas ANd ANANases in cANAN +# [anú]+n bananas and ananases in canaan +# ---------------------------------------------------------------------- +# +# Apparently the problem is specific to u-acute; I've tried several +# other 8-bit characters and they seem to behave as expected. +# +# By comparing the second and third output lines, it would seem that the +# problem involves backtracking out of a partial match of [...]* in +# order to match the next sub-expression, when the latter begins with +# one of the given characters. +# +# +# All the best, +# +# --stolfi +# +# ------------------------------------------------------------------------ +# Jorge Stolfi | http://www.dcc.unicamp.br/~stolfi | stolfi@dcc.unicamp.br +# Institute of Computing (formerly DCC-IMECC) | Wrk +55 (19)3788-5858 +# Universidade Estadual de Campinas (UNICAMP) | +55 (19)3788-5840 +# Av. Albert Einstein 1251 - Caixa Postal 6176 | Fax +55 (19)3788-5847 +# 13083-970 Campinas, SP -- Brazil | Hom +55 (19)3287-4069 +# ------------------------------------------------------------------------ +# +# _______________________________________________ +# Bug-gnu-utils mailing list +# Bug-gnu-utils@gnu.org +# http://mail.gnu.org/mailman/listinfo/bug-gnu-utils +# +# diff --git a/test/rebt8b1.ok b/test/rebt8b1.ok new file mode 100644 index 00000000..5b8a0090 --- /dev/null +++ b/test/rebt8b1.ok @@ -0,0 +1,16 @@ +[an]*n bANas ANd ANases iAN cAN +[anú]*n bANas ANd ANases iAN cAN + +[aú]*n bANANas ANd ANANases iAN cANAN + +[an]n bANANas ANd ANANases in cANaAN +[aú]n bANANas ANd ANANases in cANaAN +[anú]n bANANas ANd ANANases in cANaAN + +[an]?n bANANas ANd ANANases iAN cANaAN +[aú]?n bANANas ANd ANANases iAN cANaAN +[anú]?n bANANas ANd ANANases iAN cANaAN + +[an]+n bANas ANd ANases in cAN +[aú]+n bANANas ANd ANANases in cANAN +[anú]+n bANas ANd ANases in cAN diff --git a/test/rebt8b2.awk b/test/rebt8b2.awk new file mode 100644 index 00000000..4cb8373c --- /dev/null +++ b/test/rebt8b2.awk @@ -0,0 +1,88 @@ +#From stolfi@ic.unicamp.br Sun Jan 28 19:02:09 2001 +#Received: from mail.actcom.co.il [192.114.47.13] +# by localhost with POP3 (fetchmail-5.5.0) +# for arnold@localhost (single-drop); Sun, 28 Jan 2001 19:02:09 +0200 (IST) +#Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Sun Jan 28 19:03:34 2001) +#X-From_: stolfi@ic.unicamp.br Sun Jan 28 18:46:02 2001 +#Received: from lmail.actcom.co.il by actcom.co.il with ESMTP +# (8.9.1a/actcom-0.2) id SAA22932 for <arobbins@actcom.co.il>; +# Sun, 28 Jan 2001 18:46:00 +0200 (EET) +# (rfc931-sender: lmail.actcom.co.il [192.114.47.13]) +#Received: from billohost.com (www.billohost.com [209.196.35.10]) +# by lmail.actcom.co.il (8.9.3/8.9.1) with ESMTP id SAA18523 +# for <arobbins@actcom.co.il>; Sun, 28 Jan 2001 18:46:35 +0200 +#Received: from grande.dcc.unicamp.br (grande.dcc.unicamp.br [143.106.7.8]) +# by billohost.com (8.9.3/8.9.3) with ESMTP id LAA20063 +# for <arnold@skeeve.com>; Sun, 28 Jan 2001 11:45:54 -0500 +#Received: from amazonas.dcc.unicamp.br (amazonas.dcc.unicamp.br [143.106.7.11]) +# by grande.dcc.unicamp.br (8.9.3/8.9.3) with ESMTP id OAA29726; +# Sun, 28 Jan 2001 14:45:47 -0200 (EDT) +#Received: from coruja.dcc.unicamp.br (coruja.dcc.unicamp.br [143.106.24.80]) +# by amazonas.dcc.unicamp.br (8.8.5/8.8.5) with ESMTP id OAA06542; +# Sun, 28 Jan 2001 14:45:45 -0200 (EDT) +#Received: (from stolfi@localhost) +# by coruja.dcc.unicamp.br (8.11.0/8.11.0) id f0SGjib16703; +# Sun, 28 Jan 2001 14:45:44 -0200 (EDT) +#Date: Sun, 28 Jan 2001 14:45:44 -0200 (EDT) +#Message-Id: <200101281645.f0SGjib16703@coruja.dcc.unicamp.br> +#From: Jorge Stolfi <stolfi@ic.unicamp.br> +#To: Michal Jaegermann <michal@ellpspace.math.ualberta.ca> +#Cc: Aharon Robbins <arnold@skeeve.com>, oliva@ic.unicamp.br, +# celio@ic.unicamp.br, ducatte@ic.unicamp.br, machado@ic.unicamp.br +#Subject: Re: a regex.c problem +#MIME-Version: 1.0 +#Content-Transfer-Encoding: 8bit +#Content-Type: text/plain; charset=iso-8859-1 +#In-Reply-To: <20010128090314.A5820@ellpspace.math.ualberta.ca> +#References: <200101281207.f0SC7Un08435@skeeve.com> +# <20010128090314.A5820@ellpspace.math.ualberta.ca> +#Reply-To: stolfi@ic.unicamp.br +#Status: RO +# +# +# > [Michal] Are there any other examples of "certain characters" +# > which would throw this regex engine off? +# +#I now tested [anX]*n for X ranging trough all characters from \000 and +#\377, and got that unexpected result only for the following ones: +# +# \370 | =F8 | ø | Small o, slash +# \371 | =F9 | ù | Small u, grave accent +# \372 | =FA | ú | Small u, acute accent +# \373 | =FB | û | Small u, circumflex accent +# \374 | =FC | ü | Small u, dieresis or umlaut mark +# \375 | =FD | ý | Small y, acute accent +# \376 | =FE | þ | Small thorn, Icelandic +# \377 | =FF | ÿ | Small y, dieresis or umlaut mark +# +#I have also tried those offending REs from inside emacs (20.7.1), with +#query-replace-regexp, and it seems to be working fine. So presumably +#the bug lies in gawk itself, or in the RE parsing code, rather than in +#the matching engine? +# +#Could it be an underdimensioned table somewhere? +# +#Thanks for the help, and all the best +# +#--stolfi +# +# ---------------------------------------------------------------------- + #! /usr/bin/gawk -f + + BEGIN { + for (c = 0; c < 256; c++) + { do_test(c); } + } + + function do_test(char, pat,s,t) + { + if (char == 92) { printf "(error for \\%03o)\n", char; return; } + pat = sprintf("[an\\%03o]*n", char); + s = "bananas and ananases in canaan"; + t = s; gsub(pat, "AN", t); printf "%-8s %s\n", pat, t; +# ADR: Added: + if (s ~ pat) printf "\tmatch\n" ; else printf "\tno-match\n" + } + +# ---------------------------------------------------------------------- diff --git a/test/rebt8b2.ok b/test/rebt8b2.ok new file mode 100644 index 00000000..661109c0 --- /dev/null +++ b/test/rebt8b2.ok @@ -0,0 +1,511 @@ +[an\000]*n bANas ANd ANases iAN cAN + match +[an\001]*n bANas ANd ANases iAN cAN + match +[an\002]*n bANas ANd ANases iAN cAN + match +[an\003]*n bANas ANd ANases iAN cAN + match +[an\004]*n bANas ANd ANases iAN cAN + match +[an\005]*n bANas ANd ANases iAN cAN + match +[an\006]*n bANas ANd ANases iAN cAN + match +[an\007]*n bANas ANd ANases iAN cAN + match +[an\010]*n bANas ANd ANases iAN cAN + match +[an\011]*n bANas ANd ANases iAN cAN + match +[an\012]*n bANas ANd ANases iAN cAN + match +[an\013]*n bANas ANd ANases iAN cAN + match +[an\014]*n bANas ANd ANases iAN cAN + match +[an\015]*n bANas ANd ANases iAN cAN + match +[an\016]*n bANas ANd ANases iAN cAN + match +[an\017]*n bANas ANd ANases iAN cAN + match +[an\020]*n bANas ANd ANases iAN cAN + match +[an\021]*n bANas ANd ANases iAN cAN + match +[an\022]*n bANas ANd ANases iAN cAN + match +[an\023]*n bANas ANd ANases iAN cAN + match +[an\024]*n bANas ANd ANases iAN cAN + match +[an\025]*n bANas ANd ANases iAN cAN + match +[an\026]*n bANas ANd ANases iAN cAN + match +[an\027]*n bANas ANd ANases iAN cAN + match +[an\030]*n bANas ANd ANases iAN cAN + match +[an\031]*n bANas ANd ANases iAN cAN + match +[an\032]*n bANas ANd ANases iAN cAN + match +[an\033]*n bANas ANd ANases iAN cAN + match +[an\034]*n bANas ANd ANases iAN cAN + match +[an\035]*n bANas ANd ANases iAN cAN + match +[an\036]*n bANas ANd ANases iAN cAN + match +[an\037]*n bANas ANd ANases iAN cAN + match +[an\040]*n bANasANdANases iAN cAN + match +[an\041]*n bANas ANd ANases iAN cAN + match +[an\042]*n bANas ANd ANases iAN cAN + match +[an\043]*n bANas ANd ANases iAN cAN + match +[an\044]*n bANas ANd ANases iAN cAN + match +[an\045]*n bANas ANd ANases iAN cAN + match +[an\046]*n bANas ANd ANases iAN cAN + match +[an\047]*n bANas ANd ANases iAN cAN + match +[an\050]*n bANas ANd ANases iAN cAN + match +[an\051]*n bANas ANd ANases iAN cAN + match +[an\052]*n bANas ANd ANases iAN cAN + match +[an\053]*n bANas ANd ANases iAN cAN + match +[an\054]*n bANas ANd ANases iAN cAN + match +[an\055]*n bANas ANd ANases iAN cAN + match +[an\056]*n bANas ANd ANases iAN cAN + match +[an\057]*n bANas ANd ANases iAN cAN + match +[an\060]*n bANas ANd ANases iAN cAN + match +[an\061]*n bANas ANd ANases iAN cAN + match +[an\062]*n bANas ANd ANases iAN cAN + match +[an\063]*n bANas ANd ANases iAN cAN + match +[an\064]*n bANas ANd ANases iAN cAN + match +[an\065]*n bANas ANd ANases iAN cAN + match +[an\066]*n bANas ANd ANases iAN cAN + match +[an\067]*n bANas ANd ANases iAN cAN + match +[an\070]*n bANas ANd ANases iAN cAN + match +[an\071]*n bANas ANd ANases iAN cAN + match +[an\072]*n bANas ANd ANases iAN cAN + match +[an\073]*n bANas ANd ANases iAN cAN + match +[an\074]*n bANas ANd ANases iAN cAN + match +[an\075]*n bANas ANd ANases iAN cAN + match +[an\076]*n bANas ANd ANases iAN cAN + match +[an\077]*n bANas ANd ANases iAN cAN + match +[an\100]*n bANas ANd ANases iAN cAN + match +[an\101]*n bANas ANd ANases iAN cAN + match +[an\102]*n bANas ANd ANases iAN cAN + match +[an\103]*n bANas ANd ANases iAN cAN + match +[an\104]*n bANas ANd ANases iAN cAN + match +[an\105]*n bANas ANd ANases iAN cAN + match +[an\106]*n bANas ANd ANases iAN cAN + match +[an\107]*n bANas ANd ANases iAN cAN + match +[an\110]*n bANas ANd ANases iAN cAN + match +[an\111]*n bANas ANd ANases iAN cAN + match +[an\112]*n bANas ANd ANases iAN cAN + match +[an\113]*n bANas ANd ANases iAN cAN + match +[an\114]*n bANas ANd ANases iAN cAN + match +[an\115]*n bANas ANd ANases iAN cAN + match +[an\116]*n bANas ANd ANases iAN cAN + match +[an\117]*n bANas ANd ANases iAN cAN + match +[an\120]*n bANas ANd ANases iAN cAN + match +[an\121]*n bANas ANd ANases iAN cAN + match +[an\122]*n bANas ANd ANases iAN cAN + match +[an\123]*n bANas ANd ANases iAN cAN + match +[an\124]*n bANas ANd ANases iAN cAN + match +[an\125]*n bANas ANd ANases iAN cAN + match +[an\126]*n bANas ANd ANases iAN cAN + match +[an\127]*n bANas ANd ANases iAN cAN + match +[an\130]*n bANas ANd ANases iAN cAN + match +[an\131]*n bANas ANd ANases iAN cAN + match +[an\132]*n bANas ANd ANases iAN cAN + match +[an\133]*n bANas ANd ANases iAN cAN + match +(error for \134) +[an\135]*n bANANas ANd ANANases in cANaAN + match +[an\136]*n bANas ANd ANases iAN cAN + match +[an\137]*n bANas ANd ANases iAN cAN + match +[an\140]*n bANas ANd ANases iAN cAN + match +[an\141]*n bANas ANd ANases iAN cAN + match +[an\142]*n ANas ANd ANases iAN cAN + match +[an\143]*n bANas ANd ANases iAN AN + match +[an\144]*n bANas ANd ANases iAN cAN + match +[an\145]*n bANas ANd ANases iAN cAN + match +[an\146]*n bANas ANd ANases iAN cAN + match +[an\147]*n bANas ANd ANases iAN cAN + match +[an\150]*n bANas ANd ANases iAN cAN + match +[an\151]*n bANas ANd ANases AN cAN + match +[an\152]*n bANas ANd ANases iAN cAN + match +[an\153]*n bANas ANd ANases iAN cAN + match +[an\154]*n bANas ANd ANases iAN cAN + match +[an\155]*n bANas ANd ANases iAN cAN + match +[an\156]*n bANas ANd ANases iAN cAN + match +[an\157]*n bANas ANd ANases iAN cAN + match +[an\160]*n bANas ANd ANases iAN cAN + match +[an\161]*n bANas ANd ANases iAN cAN + match +[an\162]*n bANas ANd ANases iAN cAN + match +[an\163]*n bANas ANd ANases iAN cAN + match +[an\164]*n bANas ANd ANases iAN cAN + match +[an\165]*n bANas ANd ANases iAN cAN + match +[an\166]*n bANas ANd ANases iAN cAN + match +[an\167]*n bANas ANd ANases iAN cAN + match +[an\170]*n bANas ANd ANases iAN cAN + match +[an\171]*n bANas ANd ANases iAN cAN + match +[an\172]*n bANas ANd ANases iAN cAN + match +[an\173]*n bANas ANd ANases iAN cAN + match +[an\174]*n bANas ANd ANases iAN cAN + match +[an\175]*n bANas ANd ANases iAN cAN + match +[an\176]*n bANas ANd ANases iAN cAN + match +[an\177]*n bANas ANd ANases iAN cAN + match +[an\200]*n bANas ANd ANases iAN cAN + match +[an\201]*n bANas ANd ANases iAN cAN + match +[an\202]*n bANas ANd ANases iAN cAN + match +[an\203]*n bANas ANd ANases iAN cAN + match +[an\204]*n bANas ANd ANases iAN cAN + match +[an\205]*n bANas ANd ANases iAN cAN + match +[an\206]*n bANas ANd ANases iAN cAN + match +[an\207]*n bANas ANd ANases iAN cAN + match +[an\210]*n bANas ANd ANases iAN cAN + match +[an\211]*n bANas ANd ANases iAN cAN + match +[an\212]*n bANas ANd ANases iAN cAN + match +[an\213]*n bANas ANd ANases iAN cAN + match +[an\214]*n bANas ANd ANases iAN cAN + match +[an\215]*n bANas ANd ANases iAN cAN + match +[an\216]*n bANas ANd ANases iAN cAN + match +[an\217]*n bANas ANd ANases iAN cAN + match +[an\220]*n bANas ANd ANases iAN cAN + match +[an\221]*n bANas ANd ANases iAN cAN + match +[an\222]*n bANas ANd ANases iAN cAN + match +[an\223]*n bANas ANd ANases iAN cAN + match +[an\224]*n bANas ANd ANases iAN cAN + match +[an\225]*n bANas ANd ANases iAN cAN + match +[an\226]*n bANas ANd ANases iAN cAN + match +[an\227]*n bANas ANd ANases iAN cAN + match +[an\230]*n bANas ANd ANases iAN cAN + match +[an\231]*n bANas ANd ANases iAN cAN + match +[an\232]*n bANas ANd ANases iAN cAN + match +[an\233]*n bANas ANd ANases iAN cAN + match +[an\234]*n bANas ANd ANases iAN cAN + match +[an\235]*n bANas ANd ANases iAN cAN + match +[an\236]*n bANas ANd ANases iAN cAN + match +[an\237]*n bANas ANd ANases iAN cAN + match +[an\240]*n bANas ANd ANases iAN cAN + match +[an\241]*n bANas ANd ANases iAN cAN + match +[an\242]*n bANas ANd ANases iAN cAN + match +[an\243]*n bANas ANd ANases iAN cAN + match +[an\244]*n bANas ANd ANases iAN cAN + match +[an\245]*n bANas ANd ANases iAN cAN + match +[an\246]*n bANas ANd ANases iAN cAN + match +[an\247]*n bANas ANd ANases iAN cAN + match +[an\250]*n bANas ANd ANases iAN cAN + match +[an\251]*n bANas ANd ANases iAN cAN + match +[an\252]*n bANas ANd ANases iAN cAN + match +[an\253]*n bANas ANd ANases iAN cAN + match +[an\254]*n bANas ANd ANases iAN cAN + match +[an\255]*n bANas ANd ANases iAN cAN + match +[an\256]*n bANas ANd ANases iAN cAN + match +[an\257]*n bANas ANd ANases iAN cAN + match +[an\260]*n bANas ANd ANases iAN cAN + match +[an\261]*n bANas ANd ANases iAN cAN + match +[an\262]*n bANas ANd ANases iAN cAN + match +[an\263]*n bANas ANd ANases iAN cAN + match +[an\264]*n bANas ANd ANases iAN cAN + match +[an\265]*n bANas ANd ANases iAN cAN + match +[an\266]*n bANas ANd ANases iAN cAN + match +[an\267]*n bANas ANd ANases iAN cAN + match +[an\270]*n bANas ANd ANases iAN cAN + match +[an\271]*n bANas ANd ANases iAN cAN + match +[an\272]*n bANas ANd ANases iAN cAN + match +[an\273]*n bANas ANd ANases iAN cAN + match +[an\274]*n bANas ANd ANases iAN cAN + match +[an\275]*n bANas ANd ANases iAN cAN + match +[an\276]*n bANas ANd ANases iAN cAN + match +[an\277]*n bANas ANd ANases iAN cAN + match +[an\300]*n bANas ANd ANases iAN cAN + match +[an\301]*n bANas ANd ANases iAN cAN + match +[an\302]*n bANas ANd ANases iAN cAN + match +[an\303]*n bANas ANd ANases iAN cAN + match +[an\304]*n bANas ANd ANases iAN cAN + match +[an\305]*n bANas ANd ANases iAN cAN + match +[an\306]*n bANas ANd ANases iAN cAN + match +[an\307]*n bANas ANd ANases iAN cAN + match +[an\310]*n bANas ANd ANases iAN cAN + match +[an\311]*n bANas ANd ANases iAN cAN + match +[an\312]*n bANas ANd ANases iAN cAN + match +[an\313]*n bANas ANd ANases iAN cAN + match +[an\314]*n bANas ANd ANases iAN cAN + match +[an\315]*n bANas ANd ANases iAN cAN + match +[an\316]*n bANas ANd ANases iAN cAN + match +[an\317]*n bANas ANd ANases iAN cAN + match +[an\320]*n bANas ANd ANases iAN cAN + match +[an\321]*n bANas ANd ANases iAN cAN + match +[an\322]*n bANas ANd ANases iAN cAN + match +[an\323]*n bANas ANd ANases iAN cAN + match +[an\324]*n bANas ANd ANases iAN cAN + match +[an\325]*n bANas ANd ANases iAN cAN + match +[an\326]*n bANas ANd ANases iAN cAN + match +[an\327]*n bANas ANd ANases iAN cAN + match +[an\330]*n bANas ANd ANases iAN cAN + match +[an\331]*n bANas ANd ANases iAN cAN + match +[an\332]*n bANas ANd ANases iAN cAN + match +[an\333]*n bANas ANd ANases iAN cAN + match +[an\334]*n bANas ANd ANases iAN cAN + match +[an\335]*n bANas ANd ANases iAN cAN + match +[an\336]*n bANas ANd ANases iAN cAN + match +[an\337]*n bANas ANd ANases iAN cAN + match +[an\340]*n bANas ANd ANases iAN cAN + match +[an\341]*n bANas ANd ANases iAN cAN + match +[an\342]*n bANas ANd ANases iAN cAN + match +[an\343]*n bANas ANd ANases iAN cAN + match +[an\344]*n bANas ANd ANases iAN cAN + match +[an\345]*n bANas ANd ANases iAN cAN + match +[an\346]*n bANas ANd ANases iAN cAN + match +[an\347]*n bANas ANd ANases iAN cAN + match +[an\350]*n bANas ANd ANases iAN cAN + match +[an\351]*n bANas ANd ANases iAN cAN + match +[an\352]*n bANas ANd ANases iAN cAN + match +[an\353]*n bANas ANd ANases iAN cAN + match +[an\354]*n bANas ANd ANases iAN cAN + match +[an\355]*n bANas ANd ANases iAN cAN + match +[an\356]*n bANas ANd ANases iAN cAN + match +[an\357]*n bANas ANd ANases iAN cAN + match +[an\360]*n bANas ANd ANases iAN cAN + match +[an\361]*n bANas ANd ANases iAN cAN + match +[an\362]*n bANas ANd ANases iAN cAN + match +[an\363]*n bANas ANd ANases iAN cAN + match +[an\364]*n bANas ANd ANases iAN cAN + match +[an\365]*n bANas ANd ANases iAN cAN + match +[an\366]*n bANas ANd ANases iAN cAN + match +[an\367]*n bANas ANd ANases iAN cAN + match +[an\370]*n bANas ANd ANases iAN cAN + match +[an\371]*n bANas ANd ANases iAN cAN + match +[an\372]*n bANas ANd ANases iAN cAN + match +[an\373]*n bANas ANd ANases iAN cAN + match +[an\374]*n bANas ANd ANases iAN cAN + match +[an\375]*n bANas ANd ANases iAN cAN + match +[an\376]*n bANas ANd ANases iAN cAN + match +[an\377]*n bANas ANd ANases iAN cAN + match diff --git a/test/redfilnm.awk b/test/redfilnm.awk new file mode 100644 index 00000000..83cb6aa9 --- /dev/null +++ b/test/redfilnm.awk @@ -0,0 +1,98 @@ +#Date: Tue, 18 May 1999 12:48:07 -0500 (CDT) +#From: Darrel Hankerson <hankedr@dms.auburn.edu> +#To: arnold@gnu.org +#Subject: [christopher.procter@bt.com: RE: Getline bug in Gawk 3.0.3] +# +#Here's a reply that came directly to me. --darrel +# +# +#From: christopher.procter@bt.com +#To: hankedr@dms.auburn.edu +#Subject: RE: Getline bug in Gawk 3.0.3 +#Date: Tue, 18 May 1999 18:42:28 +0100 +# +#Sorry that was me getting carried away and cut and pasting the wrong thing +#into my email +# +#The real problem seems to be that : +#BEGIN { +#for (i=1;i<10;i++){ +# while((getline < "hello.txt")>0){ +# print $0 +# } +# close("hello.txt") +# } +#} +#works (printing the contents of hello.txt 9 times), where as:- +# +#END{ +#for (i=1;i<10;i++){ +# while((getline < "hello.txt")>0){ +# print $0 +# } +# close("hello.txt") +# } +#} +# +#doesn't, (it prints out hello.txt once followed by the iteration numbers +#from 1 to 9). +#The only difference is that one is in the BEGIN block and one in the END +#block. +# +#Sorry about the first post, I'm not a bad awk programmer, just a tired one +#:) +# +#chris +# +#> -----Original Message----- +#> From: Darrel Hankerson [SMTP:hankedr@dms.auburn.edu] +#> Sent: 18 May 1999 18:28 +#> To: christopher.procter@bt.com +#> Subject: Re: Getline bug in Gawk 3.0.3 +#> +#> Could you clarify? Your first script uses an apparently undefined +#> variable f. +#> +#> +#> christopher.procter@bt.com writes: +#> +#> BEGIN { +#> for (i=1;i<10;i++){ +#> while((getline < "hello.txt")>0){ +#> print $0 +#> } +#> close(f) +#> } +#> } +#> +#> refuses to close the file and so prints the contents of hello.txt just +#> once. +#> However:- +#> +#> BEGIN { +#> f="hello.txt" +#> for (i=1;i<10;i++){ +#> while((getline < f)>0){ +#> print $0 +#> } +#> close(f) +#> } +#> } +#> +#> works as advertised (printing the contents of hello.txt 9 times) +#> It seems like a bug in the close statement. +#> +#> -- +#> --Darrel Hankerson hankedr@mail.auburn.edu +# + +# srcdir is assigned on command line --- ADR +END { + f = srcdir "/redfilnm.in" + for (i = 1; i < 10; i++){ + while((getline < f) > 0){ + print $0 + } + close(f) + } +} diff --git a/test/redfilnm.in b/test/redfilnm.in new file mode 100644 index 00000000..4b5fa637 --- /dev/null +++ b/test/redfilnm.in @@ -0,0 +1 @@ +hello, world diff --git a/test/redfilnm.ok b/test/redfilnm.ok new file mode 100644 index 00000000..f9e095a7 --- /dev/null +++ b/test/redfilnm.ok @@ -0,0 +1,9 @@ +hello, world +hello, world +hello, world +hello, world +hello, world +hello, world +hello, world +hello, world +hello, world diff --git a/test/regeq.awk b/test/regeq.awk new file mode 100644 index 00000000..0208eb24 --- /dev/null +++ b/test/regeq.awk @@ -0,0 +1,29 @@ +#Date: Sat, 8 May 1999 17:42:20 +0200 +#From: Iva Cabric <ivac@fly.srk.fer.hr> +#To: bug-gnu-utils@gnu.org +#Cc: arnold@gnu.org +#Subject: Problem in gawk with match +# +#Hello, +# +#gawk reports fatal error in match when first character in regexp is "=" : +# +#$ gawk '{ where = match($0, /=a/); print where}' +#gawk: cmd. line:1: { where = match($0, /=a/); print where} +#gawk: cmd. line:1: ^ parse error +#gawk: cmd. line:1: fatal: match() cannot have 0 arguments +# +#Using "\=" instead "=" works without problems : +# +#$ gawk '{ where = match($0, /\=a/); print where}' +#sdgfa +#0 +#asdfds=a +#7 +# +#Other versions of awk have no problems with "/=/" (except oawk on SunOS). +# +#-- +# @ +# +{ where = match($0, /=a/); print where} diff --git a/test/regeq.in b/test/regeq.in new file mode 100644 index 00000000..2428df3a --- /dev/null +++ b/test/regeq.in @@ -0,0 +1,2 @@ +sdgfa +asdfds=a diff --git a/test/regeq.ok b/test/regeq.ok new file mode 100644 index 00000000..4596f886 --- /dev/null +++ b/test/regeq.ok @@ -0,0 +1,2 @@ +0 +7 diff --git a/test/regtest b/test/regtest.sh index 72b0dbf9..72b0dbf9 100755 --- a/test/regtest +++ b/test/regtest.sh diff --git a/test/regx8bit.awk b/test/regx8bit.awk new file mode 100644 index 00000000..5ecd7eb2 --- /dev/null +++ b/test/regx8bit.awk @@ -0,0 +1,26 @@ +# The full test will only work in a Swedish localte +# Try things that should work across the board +# BEGIN { +# s = "så är det" +# print match(s,/\yså\y/), s ~ /\yså\y/, "å" ~ /\w/ +# } +BEGIN { + printf "\"å\" = %c\n", "å" + printf "\"ä\" = %c\n", "ä" + s = "så är det" + printf "s = \"%s\"\n", s + printf "match(s,/\\yså/) = %d\n", match(s, /\yså/) +# printf "match(s,/så\\y/) = %d\n", match(s, /så\y/) +# printf "match(s,/\\yså\\y/) = %d\n", match(s, /\yså\y/) + printf "s ~ /å/ = %d\n", s ~ /å/ + printf "s ~ /så/ = %d\n", s ~ /så/ + printf "s ~ /\\yså/ = %d\n", s ~ /\yså/ +# printf "s ~ /så\\y/ = %d\n", s ~ /så\y/ +# printf "s ~ /\\yså\\y/ = %d\n", s ~ /\yså\y/ +# printf "\"å\" ~ /\\w/ = %d\n", "å" ~ /\w/ +# printf "\"ä\" ~ /\\w/ = %d\n", "ä" ~ /\w/ +# printf "\"å\" ~ /\\yä\\y/ = %d\n", "å" ~ /\yå\y/ +# printf "\"ä\" ~ /\\yä\\y/ = %d\n", "ä" ~ /\yä\y/ +# printf "\"å\" ~ /[[:alpha:]]/ = %d\n", "å" ~ /[[:alpha:]]/ +# printf "\"ä\" ~ /[[:alpha:]]/ = %d\n", "ä" ~ /[[:alpha:]]/ +} diff --git a/test/regx8bit.ok b/test/regx8bit.ok new file mode 100644 index 00000000..76e1c0b1 --- /dev/null +++ b/test/regx8bit.ok @@ -0,0 +1,7 @@ +"å" = å +"ä" = ä +s = "så är det" +match(s,/\yså/) = 1 +s ~ /å/ = 1 +s ~ /så/ = 1 +s ~ /\yså/ = 1 diff --git a/test/rsnul1nl.awk b/test/rsnul1nl.awk new file mode 100644 index 00000000..d8da7a64 --- /dev/null +++ b/test/rsnul1nl.awk @@ -0,0 +1,2 @@ +BEGIN { RS = "" } +{ print } diff --git a/test/rsnul1nl.in b/test/rsnul1nl.in new file mode 100644 index 00000000..76de96fc --- /dev/null +++ b/test/rsnul1nl.in @@ -0,0 +1,3 @@ + +This is... +the first record. diff --git a/test/rsnul1nl.ok b/test/rsnul1nl.ok new file mode 100644 index 00000000..7ce0957b --- /dev/null +++ b/test/rsnul1nl.ok @@ -0,0 +1,2 @@ +This is... +the first record. diff --git a/test/sclforin.ok b/test/sclforin.ok index d87fa61f..f41fc77a 100644 --- a/test/sclforin.ok +++ b/test/sclforin.ok @@ -1 +1 @@ -gawk: sclforin.awk:1: fatal: attempt to use scalar as array +gawk: sclforin.awk:1: fatal: attempt to use scalar `j' as array diff --git a/test/sclifin.ok b/test/sclifin.ok index 717f8368..dc746231 100644 --- a/test/sclifin.ok +++ b/test/sclifin.ok @@ -1 +1 @@ -gawk: sclifin.awk:7: fatal: attempt to use scalar as array +gawk: sclifin.awk:7: fatal: attempt to use scalar `j' as array diff --git a/test/shadow.awk b/test/shadow.awk new file mode 100644 index 00000000..9a587203 --- /dev/null +++ b/test/shadow.awk @@ -0,0 +1,21 @@ +function foo() +{ + print "foo" +} + +function bar(A, Z, q) +{ + print "bar" +} + +function baz(C, D) +{ + print "baz" +} + +BEGIN { + A = C = D = Z = y = 1 + foo() + bar() + baz() +} diff --git a/test/shadow.ok b/test/shadow.ok new file mode 100644 index 00000000..f543a883 --- /dev/null +++ b/test/shadow.ok @@ -0,0 +1,7 @@ +gawk: shadow.awk:22: warning: function `bar': parameter `A' shadows global variable +gawk: shadow.awk:22: warning: function `bar': parameter `Z' shadows global variable +gawk: shadow.awk:22: warning: function `baz': parameter `C' shadows global variable +gawk: shadow.awk:22: warning: function `baz': parameter `D' shadows global variable +foo +bar +baz diff --git a/test/sort1.awk b/test/sort1.awk new file mode 100644 index 00000000..3800c40e --- /dev/null +++ b/test/sort1.awk @@ -0,0 +1,31 @@ +BEGIN{ + a[1] = "barz"; + a[2] = "blattt"; + a[3] = "Zebra"; + a[4] = 1234; + + testit1(a) + + delete a + + a[1] = "barz"; + a[2] = "blattt"; + a[3] = "Zebra"; + a[4] = 1234; + + n = asort(a, b); + + print "N = ", n; + + for(i=1; i <= n; i++) + print i, a[i], b[i]; +} + +function testit1(a, count, j) +{ + print "start testit" + count = asort(a) + for (j = 1; j <= count; j++) + print j, a[j] + print "end testit" +} diff --git a/test/sort1.ok b/test/sort1.ok new file mode 100644 index 00000000..4838daba --- /dev/null +++ b/test/sort1.ok @@ -0,0 +1,11 @@ +start testit +1 1234 +2 Zebra +3 barz +4 blattt +end testit +N = 4 +1 barz 1234 +2 blattt Zebra +3 Zebra barz +4 1234 blattt diff --git a/test/splitdef.awk b/test/splitdef.awk new file mode 100644 index 00000000..694db80a --- /dev/null +++ b/test/splitdef.awk @@ -0,0 +1,7 @@ +BEGIN { + data = "abc:easy:as:one:two:three" + FS = ":" + FIELDWIDTHS = "3 1 4 1 2 1 3 1 3 1 5" + n = split(data, a) + printf "n = %d, a[3] = %s\n", n, a[3] +} diff --git a/test/splitdef.ok b/test/splitdef.ok new file mode 100644 index 00000000..5f13505f --- /dev/null +++ b/test/splitdef.ok @@ -0,0 +1 @@ +n = 6, a[3] = as diff --git a/test/strtod.awk b/test/strtod.awk new file mode 100644 index 00000000..27df8a4f --- /dev/null +++ b/test/strtod.awk @@ -0,0 +1 @@ +{ x = "0x" $1 ; print x, x + 0 } diff --git a/test/strtod.in b/test/strtod.in new file mode 100644 index 00000000..51b40081 --- /dev/null +++ b/test/strtod.in @@ -0,0 +1 @@ +345 diff --git a/test/strtod.ok b/test/strtod.ok new file mode 100644 index 00000000..bedd0f23 --- /dev/null +++ b/test/strtod.ok @@ -0,0 +1 @@ +0x345 0 |