diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:41:09 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:41:09 +0300 |
commit | 8c042f99cc7465c86351d21331a129111b75345d (patch) | |
tree | 9656e653be0e42e5469cec77635c20356de152c2 /test | |
parent | 8ceb5f934787eb7be5fb452fb39179df66119954 (diff) | |
download | egawk-8c042f99cc7465c86351d21331a129111b75345d.tar.gz egawk-8c042f99cc7465c86351d21331a129111b75345d.tar.bz2 egawk-8c042f99cc7465c86351d21331a129111b75345d.zip |
Move to gawk-3.0.0.
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 3 | ||||
-rw-r--r-- | test/Makefile | 239 | ||||
-rw-r--r-- | test/Makefile.in | 279 | ||||
-rw-r--r-- | test/README | 15 | ||||
-rw-r--r-- | test/anchgsub.ok (renamed from test/anchgsub.good) | 0 | ||||
-rw-r--r-- | test/argarray.in | 1 | ||||
-rw-r--r-- | test/argarray.ok (renamed from test/argarray.good) | 4 | ||||
-rw-r--r-- | test/argtest.ok (renamed from test/argtest.good) | 0 | ||||
-rw-r--r-- | test/arrayparm.ok (renamed from test/arrayparm.good) | 0 | ||||
-rw-r--r-- | test/arrayref.awk (renamed from test/arrayref) | 0 | ||||
-rw-r--r-- | test/arrayref.ok (renamed from test/arrayref.good) | 0 | ||||
-rw-r--r-- | test/asgext.ok (renamed from test/asgext.good) | 0 | ||||
-rw-r--r-- | test/awkpath.ok (renamed from test/awkpath.good) | 0 | ||||
-rw-r--r-- | test/badargs.ok (renamed from test/badargs.good) | 5 | ||||
-rw-r--r-- | test/childin.ok | 1 | ||||
-rw-r--r-- | test/compare.ok (renamed from test/compare.good) | 0 | ||||
-rw-r--r-- | test/convfmt.ok (renamed from test/convfmt.good) | 0 | ||||
-rw-r--r-- | test/csi1.out | 574 | ||||
-rw-r--r-- | test/defref.awk | 1 | ||||
-rw-r--r-- | test/defref.ok | 2 | ||||
-rw-r--r-- | test/fflush.ok | 16 | ||||
-rwxr-xr-x | test/fflush.sh | 16 | ||||
-rw-r--r-- | test/fieldwdth.ok (renamed from test/fieldwdth.good) | 0 | ||||
-rw-r--r-- | test/fldchg.awk | 8 | ||||
-rw-r--r-- | test/fldchg.in | 1 | ||||
-rw-r--r-- | test/fldchg.ok | 3 | ||||
-rw-r--r-- | test/fontdata.txt | 120 | ||||
-rw-r--r-- | test/fsbs.ok (renamed from test/fsbs.good) | 0 | ||||
-rw-r--r-- | test/fsrs.ok (renamed from test/fsrs.good) | 0 | ||||
-rw-r--r-- | test/fstabplus.awk (renamed from test/fstabplus) | 0 | ||||
-rw-r--r-- | test/fstabplus.ok (renamed from test/fstabplus.good) | 0 | ||||
-rw-r--r-- | test/gensub.awk | 6 | ||||
-rw-r--r-- | test/gensub.in | 2 | ||||
-rw-r--r-- | test/gensub.ok | 3 | ||||
-rw-r--r-- | test/getline.ok (renamed from test/getline.good) | 0 | ||||
-rw-r--r-- | test/gnureops.awk | 45 | ||||
-rw-r--r-- | test/gnureops.ok | 17 | ||||
-rw-r--r-- | test/header.awk | 5 | ||||
-rw-r--r-- | test/igncfs.ok (renamed from test/igncfs.good) | 0 | ||||
-rw-r--r-- | test/ignrcase.ok (renamed from test/ignrcase.good) | 0 | ||||
-rw-r--r-- | test/include.awk | 13 | ||||
-rw-r--r-- | test/inftest.ok (renamed from test/inftest.good) | 0 | ||||
-rw-r--r-- | test/intprec.awk | 1 | ||||
-rw-r--r-- | test/intprec.ok | 1 | ||||
-rw-r--r-- | test/lastnpages | 47 | ||||
-rw-r--r-- | test/litoct.awk | 1 | ||||
-rw-r--r-- | test/litoct.ok | 1 | ||||
-rw-r--r-- | test/longwrds.ok (renamed from test/longwrds.good) | 0 | ||||
-rw-r--r-- | test/math.awk | 10 | ||||
-rw-r--r-- | test/math.ok | 6 | ||||
-rw-r--r-- | test/negexp.ok (renamed from test/negexp.good) | 0 | ||||
-rw-r--r-- | test/nfset.ok (renamed from test/nfset.good) | 0 | ||||
-rw-r--r-- | test/noeffect.awk | 4 | ||||
-rw-r--r-- | test/noeffect.ok | 2 | ||||
-rw-r--r-- | test/nofmtch.awk | 1 | ||||
-rw-r--r-- | test/nofmtch.ok | 2 | ||||
-rw-r--r-- | test/nonl.ok (renamed from test/nonl.good) | 0 | ||||
-rw-r--r-- | test/numfunc.awk | 19 | ||||
-rw-r--r-- | test/numsubstr.awk | 1 | ||||
-rw-r--r-- | test/numsubstr.in | 3 | ||||
-rw-r--r-- | test/numsubstr.ok | 3 | ||||
-rw-r--r-- | test/out1.ok (renamed from test/out1.good) | 0 | ||||
-rw-r--r-- | test/out2.ok (renamed from test/out2.good) | 0 | ||||
-rw-r--r-- | test/out3.ok (renamed from test/out3.good) | 0 | ||||
-rw-r--r-- | test/paramdup.ok (renamed from test/paramdup.good) | 0 | ||||
-rw-r--r-- | test/pcntplus.awk | 1 | ||||
-rw-r--r-- | test/pcntplus.ok | 1 | ||||
-rw-r--r-- | test/plus-minus | 8 | ||||
-rw-r--r--[-rwxr-xr-x] | test/posix.awk (renamed from test/posix) | 0 | ||||
-rw-r--r-- | test/posix.ok (renamed from test/posix.good) | 0 | ||||
-rw-r--r-- | test/poundbang.ok (renamed from test/poundbang.good) | 0 | ||||
-rw-r--r-- | test/prmarscl.awk | 6 | ||||
-rw-r--r-- | test/prmarscl.ok | 1 | ||||
-rw-r--r-- | test/prmreuse.awk | 14 | ||||
-rw-r--r-- | test/prmreuse.ok | 0 | ||||
-rw-r--r-- | test/reparse.ok (renamed from test/reparse.good) | 0 | ||||
-rw-r--r-- | test/resplit.ok | 1 | ||||
-rw-r--r-- | test/reverse.awk | 13 | ||||
-rw-r--r-- | test/rs.in (renamed from test/rs.data) | 0 | ||||
-rw-r--r-- | test/rs.ok (renamed from test/rs.good) | 0 | ||||
-rw-r--r-- | test/rswhite.awk | 2 | ||||
-rw-r--r-- | test/rswhite.in | 2 | ||||
-rw-r--r-- | test/rswhite.ok | 2 | ||||
-rw-r--r-- | test/sclforin.awk | 1 | ||||
-rw-r--r-- | test/sclforin.ok | 1 | ||||
-rw-r--r-- | test/sclifin.awk | 7 | ||||
-rw-r--r-- | test/sclifin.ok | 1 | ||||
-rw-r--r-- | test/splitargv.ok (renamed from test/splitargv.good) | 0 | ||||
-rw-r--r-- | test/sqrt.awk | 4 | ||||
-rw-r--r-- | test/strftime.ok | 1 | ||||
-rw-r--r-- | test/swaplns.in (renamed from test/data) | 0 | ||||
-rw-r--r-- | test/swaplns.ok (renamed from test/swaplns.good) | 0 | ||||
-rw-r--r-- | test/up_down.awk | 15 | ||||
-rw-r--r-- | test/zap_cpp.awk | 13 |
94 files changed, 669 insertions, 906 deletions
diff --git a/test/ChangeLog b/test/ChangeLog new file mode 100644 index 00000000..570c031b --- /dev/null +++ b/test/ChangeLog @@ -0,0 +1,3 @@ +Wed Jan 10 22:58:55 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us> + + * ChangeLog created. diff --git a/test/Makefile b/test/Makefile index 1ad2b2c7..1ec91c45 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,9 +1,10 @@ +# Generated automatically from Makefile.in by configure. # Makefile for GNU Awk test suite. # # Copyright (C) 1988-1995 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the -# AWK Progamming Language. +# 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 @@ -16,27 +17,33 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GAWK; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# 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 = . bigtest: basic poundbang 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 + convfmt arrayparm paramdup nonl defref nofmtch litoct resplit \ + rswhite prmarscl sclforin sclifin intprec childin noeffect \ + numsubstr pcntplus prmreuse math fflush fldchg gawk.extensions: fieldwdth ignrcase posix manyfiles igncfs argtest \ - badargs + badargs strftime gensub gnureops extra: regtest inftest poundbang:: - cp ../gawk /tmp && chmod +x poundbang && ./poundbang poundbang >tmp + cp $(AWK) /tmp/gawk && $(srcdir)/poundbang $(srcdir)/poundbang >_`basename $@` rm -f /tmp/gawk - cmp poundbang.good tmp && rm -f tmp + $(CMP) $(srcdir)/poundbang.ok _`basename $@` && rm -f _`basename $@` msg:: @echo 'Any output from "cmp" is bad news, although some differences' @@ -45,140 +52,228 @@ msg:: @echo 'precision may lead to slightly different output in a few cases.' swaplns:: - @../gawk -f swaplns.awk data >tmp - cmp swaplns.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/swaplns.awk $(srcdir)/swaplns.in >_$@ + $(CMP) $(srcdir)/swaplns.ok _$@ && rm -f _$@ messages:: - @../gawk -f messages.awk >out2 2>out3 - { cmp out1.good out1 && cmp out2.good out2 && cmp out3.good out3 && rm -f out1 out2 out3; } || { test -d /dev/fd && echo IT IS OK THAT THIS TEST FAILED; } + @$(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 && echo IT IS OK THAT THIS TEST FAILED; } argarray:: - @TEST=test echo just a test | ../gawk -f argarray.awk argarray.awk - >tmp - cmp argarray.good tmp && rm -f tmp + @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' | ../gawk -f fstabplus >tmp - cmp fstabplus.good tmp && rm -f tmp + @echo '1 2' | $(AWK) -f $(srcdir)/fstabplus.awk >_$@ + $(CMP) $(srcdir)/fstabplus.ok _$@ && rm -f _$@ fsrs:: - @../gawk -f fsrs.awk fsrs.in >tmp - cmp fsrs.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/fsrs.awk $(srcdir)/fsrs.in >_$@ + $(CMP) $(srcdir)/fsrs.ok _$@ && rm -f _$@ igncfs:: - @../gawk -f igncfs.awk igncfs.in >tmp - cmp igncfs.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/igncfs.awk $(srcdir)/igncfs.in >_$@ + $(CMP) $(srcdir)/igncfs.ok _$@ && rm -f _$@ longwrds:: - @../gawk -f longwrds.awk manpage | sort >tmp - cmp longwrds.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/longwrds.awk $(srcdir)/manpage | sort >_$@ + $(CMP) $(srcdir)/longwrds.ok _$@ && rm -f _$@ fieldwdth:: - @echo '123456789' | ../gawk -v FIELDWIDTHS="2 3 4" '{ print $$2}' >tmp - cmp fieldwdth.good tmp && rm -f tmp + @echo '123456789' | $(AWK) -v FIELDWIDTHS="2 3 4" '{ print $$2}' >_$@ + $(CMP) $(srcdir)/fieldwdth.ok _$@ && rm -f _$@ ignrcase:: - @echo xYz | ../gawk -v IGNORECASE=1 '{ sub(/y/, ""); print}' >tmp - cmp ignrcase.good tmp && rm -f tmp + @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`/../gawk ./regtest + AWK=`pwd`/$(AWK) $(srcdir)/regtest posix:: - @echo '1:2,3 4' | ../gawk -f posix >tmp - cmp posix.good tmp && rm -f tmp + @echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@ + $(CMP) $(srcdir)/posix.ok _$@ && rm -f _$@ manyfiles:: @rm -rf junk @mkdir junk - @../gawk 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >tmp - @../gawk -f manyfiles.awk tmp tmp + @$(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/* | ../gawk '$$1 != 2' | wc -l - @rm -rf junk tmp + @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l + @rm -rf junk _$@ compare:: - @../gawk -f compare.awk 0 1 compare.in >tmp - cmp compare.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@ + $(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@ arrayref:: - @../gawk -f arrayref >tmp - cmp arrayref.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/arrayref.awk >_$@ + $(CMP) $(srcdir)/arrayref.ok _$@ && rm -f _$@ rs:: - @../gawk -v RS="" '{ print $$1, $$2}' rs.data >tmp - cmp rs.good tmp && rm -f tmp + @$(AWK) -v RS="" '{ print $$1, $$2}' $(srcdir)/rs.in >_$@ + $(CMP) $(srcdir)/rs.ok _$@ && rm -f _$@ fsbs:: - @../gawk -v FS='\' '{ print $$1, $$2 }' fsbs.in >tmp - cmp fsbs.good tmp && rm -f tmp + @$(AWK) -v FS='\' '{ print $$1, $$2 }' $(srcdir)/fsbs.in >_$@ + $(CMP) $(srcdir)/fsbs.ok _$@ && rm -f _$@ inftest:: @echo This test is very machine specific... - @../gawk -f inftest.awk >tmp - cmp inftest.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/inftest.awk >_$@ + $(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ getline:: - @../gawk -f getline.awk getline.awk getline.awk >tmp - cmp getline.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/getline.awk $(srcdir)/getline.awk $(srcdir)/getline.awk >_$@ + $(CMP) $(srcdir)/getline.ok _$@ && rm -f _$@ rand:: @echo The following line should just be 19 random numbers between 1 and 100 - @../gawk -f rand.awk + @$(AWK) -f $(srcdir)/rand.awk negexp:: - @../gawk 'BEGIN { a = -2; print 10^a }' >tmp - cmp negexp.good tmp && rm -f tmp + @$(AWK) 'BEGIN { a = -2; print 10^a }' >_$@ + $(CMP) $(srcdir)/negexp.ok _$@ && rm -f _$@ asgext:: - @../gawk -f asgext.awk asgext.in >tmp - cmp asgext.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/asgext.awk $(srcdir)/asgext.in >_$@ + $(CMP) $(srcdir)/asgext.ok _$@ && rm -f _$@ anchgsub:: - @../gawk -f anchgsub.awk anchgsub.in >tmp - cmp anchgsub.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/anchgsub.awk $(srcdir)/anchgsub.in >_$@ + $(CMP) $(srcdir)/anchgsub.ok _$@ && rm -f _$@ splitargv:: - @../gawk -f splitargv.awk splitargv.in >tmp - cmp splitargv.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/splitargv.awk $(srcdir)/splitargv.in >_$@ + $(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@ awkpath:: - @AWKPATH=".:lib" ../gawk -f awkpath.awk >tmp - cmp awkpath.good tmp && rm -f tmp + @AWKPATH="$(srcdir):$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@ + $(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@ nfset:: - @../gawk -f nfset.awk nfset.in >tmp - cmp nfset.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/nfset.awk $(srcdir)/nfset.in >_$@ + $(CMP) $(srcdir)/nfset.ok _$@ && rm -f _$@ reparse:: - @../gawk -f reparse.awk reparse.in >tmp - cmp reparse.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/reparse.awk $(srcdir)/reparse.in >_$@ + $(CMP) $(srcdir)/reparse.ok _$@ && rm -f _$@ argtest:: - @../gawk -f argtest.awk -x -y abc >tmp - cmp argtest.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@ + $(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@ badargs:: - @-../gawk -f 2>&1 | grep -v patchlevel >tmp - cmp badargs.good tmp && rm -f tmp + @-$(AWK) -f 2>&1 | grep -v patchlevel >_$@ + $(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@ convfmt:: - @../gawk -f convfmt.awk >tmp - cmp convfmt.good tmp && rm -f tmp + @$(AWK) -f $(srcdir)/convfmt.awk >_$@ + $(CMP) $(srcdir)/convfmt.ok _$@ && rm -f _$@ arrayparm:: - @-../gawk -f arrayparm.awk >tmp 2>&1 - cmp arrayparm.good tmp && rm -f tmp + @-AWKPATH=$(srcdir) $(AWK) -f arrayparm.awk >_$@ 2>&1 + $(CMP) $(srcdir)/arrayparm.ok _$@ && rm -f _$@ paramdup:: - @-../gawk -f paramdup.awk >tmp 2>&1 - cmp paramdup.good tmp && rm -f tmp + @-AWKPATH=$(srcdir) $(AWK) -f paramdup.awk >_$@ 2>&1 + $(CMP) $(srcdir)/paramdup.ok _$@ && rm -f _$@ nonl:: - @-../gawk --lint -f nonl.awk /dev/null >tmp 2>&1 - cmp nonl.good tmp && rm -f tmp + @-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 + $(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 + @date | $(AWK) '{ $$3 = sprintf("%02d", $$3 + 0) ; \ + print > "strftime.ok" ; \ + print strftime() > "'_$@'" }' + -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok + +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 + $(CMP) $(srcdir)/prmarscl.ok _$@ && rm -f _$@ + +sclforin:: + @-AWKPATH=$(srcdir) $(AWK) -f sclforin.awk > _$@ 2>&1 + $(CMP) $(srcdir)/sclforin.ok _$@ && rm -f _$@ + +sclifin:: + @-AWKPATH=$(srcdir) $(AWK) -f sclifin.awk > _$@ 2>&1 + $(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 _$@ clean: - rm -fr tmp core junk + rm -fr _* core junk diff --git a/test/Makefile.in b/test/Makefile.in new file mode 100644 index 00000000..52036d75 --- /dev/null +++ b/test/Makefile.in @@ -0,0 +1,279 @@ +# Makefile for GNU Awk test suite. +# +# Copyright (C) 1988-1995 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 poundbang 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 fflush fldchg + +gawk.extensions: fieldwdth ignrcase posix manyfiles igncfs argtest \ + badargs strftime gensub gnureops + +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 $@` + +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.' + +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; } || { test -d /dev/fd && echo IT IS OK THAT THIS TEST FAILED; } + +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 | 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 + +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:: + @echo The following line should just be 19 random numbers between 1 and 100 + @$(AWK) -f $(srcdir)/rand.awk + +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 + $(CMP) $(srcdir)/arrayparm.ok _$@ && rm -f _$@ + +paramdup:: + @-AWKPATH=$(srcdir) $(AWK) -f paramdup.awk >_$@ 2>&1 + $(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 + $(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 + @date | $(AWK) '{ $$3 = sprintf("%02d", $$3 + 0) ; \ + print > "strftime.ok" ; \ + print strftime() > "'_$@'" }' + -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok + +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 + $(CMP) $(srcdir)/prmarscl.ok _$@ && rm -f _$@ + +sclforin:: + @-AWKPATH=$(srcdir) $(AWK) -f sclforin.awk > _$@ 2>&1 + $(CMP) $(srcdir)/sclforin.ok _$@ && rm -f _$@ + +sclifin:: + @-AWKPATH=$(srcdir) $(AWK) -f sclifin.awk > _$@ 2>&1 + $(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 _$@ + +clean: + rm -fr _* core junk diff --git a/test/README b/test/README new file mode 100644 index 00000000..725d7d98 --- /dev/null +++ b/test/README @@ -0,0 +1,15 @@ +Wed Aug 16 12:22:45 PDT 1995 + +This directory contains the tests for gawk. The tests use the +following conventions. + +Given some aspect of gawk named `foo', there will be one or more +of the following files: + +foo.awk --- actual code for the test if not inline in the Makefile +foo.in --- the data for the test, if it needs data +foo.ok --- the expected results +_foo --- the actual results; generated at run time + +The _foo file will be left around if a test fails, allowing you to +compare actual and expected results, in case they differ. diff --git a/test/anchgsub.good b/test/anchgsub.ok index c33dfb95..c33dfb95 100644 --- a/test/anchgsub.good +++ b/test/anchgsub.ok diff --git a/test/argarray.in b/test/argarray.in new file mode 100644 index 00000000..bc93338c --- /dev/null +++ b/test/argarray.in @@ -0,0 +1 @@ +this is a simple test file diff --git a/test/argarray.good b/test/argarray.ok index 3bdcca63..18eb841c 100644 --- a/test/argarray.good +++ b/test/argarray.ok @@ -1,9 +1,9 @@ here we have 3 arguments which are gawk - argarray.awk + ./argarray.in - Environment variable TEST= and the current input file is called "" -in main loop, this input file is known as "argarray.awk" +in main loop, this input file is known as "./argarray.in" in main loop, this input file is known as "-" diff --git a/test/argtest.good b/test/argtest.ok index 591bc641..591bc641 100644 --- a/test/argtest.good +++ b/test/argtest.ok diff --git a/test/arrayparm.good b/test/arrayparm.ok index b315f7cf..b315f7cf 100644 --- a/test/arrayparm.good +++ b/test/arrayparm.ok diff --git a/test/arrayref b/test/arrayref.awk index 144d41a0..144d41a0 100644 --- a/test/arrayref +++ b/test/arrayref.awk diff --git a/test/arrayref.good b/test/arrayref.ok index 6ed281c7..6ed281c7 100644 --- a/test/arrayref.good +++ b/test/arrayref.ok diff --git a/test/asgext.good b/test/asgext.ok index 2c0df70f..2c0df70f 100644 --- a/test/asgext.good +++ b/test/asgext.ok diff --git a/test/awkpath.good b/test/awkpath.ok index 6cffe1b7..6cffe1b7 100644 --- a/test/awkpath.good +++ b/test/awkpath.ok diff --git a/test/badargs.good b/test/badargs.ok index 76d8e860..a4652933 100644 --- a/test/badargs.good +++ b/test/badargs.ok @@ -1,5 +1,5 @@ gawk: option requires an argument -- f -Usage: gawk [POSIX or GNU style options] -f progfile [--] file ... +Usage: gawk [POSIX or GNU style options] -f progfile [--] file ... gawk [POSIX or GNU style options] [--] 'program' file ... POSIX options: GNU long options: -f progfile --file=progfile @@ -11,7 +11,10 @@ POSIX options: GNU long options: -W copyright --copyright -W help --help -W lint --lint + -W lint-old --lint-old -W posix --posix + -W re-interval --re-interval -W source=program-text --source=program-text + -W traditional --traditional -W usage --usage -W version --version diff --git a/test/childin.ok b/test/childin.ok new file mode 100644 index 00000000..45b983be --- /dev/null +++ b/test/childin.ok @@ -0,0 +1 @@ +hi diff --git a/test/compare.good b/test/compare.ok index 8241359b..8241359b 100644 --- a/test/compare.good +++ b/test/compare.ok diff --git a/test/convfmt.good b/test/convfmt.ok index a7b66f78..a7b66f78 100644 --- a/test/convfmt.good +++ b/test/convfmt.ok diff --git a/test/csi1.out b/test/csi1.out deleted file mode 100644 index f93c2cc2..00000000 --- a/test/csi1.out +++ /dev/null @@ -1,574 +0,0 @@ -Title: Ideal Charge Sensitive Amp -Date: today -Plotname: Transient analysis. -Flags: real -No. Variables: 7 -No. Points: 70 -Variables: 0 time time - 1 v(1) voltage - 2 v(3) voltage - 3 v(5) voltage - 4 v(9) voltage - 5 v(11) voltage - 6 v(13) voltage -Values: - 0 0.000000000000000e+00 - 0.000000000000000e+00 - 0.000000000000000e+00 - 0.000000000000000e+00 - 0.000000000000000e+00 - 0.000000000000000e+00 - 0.000000000000000e+00 - - 1 1.000000000000000e-09 - -1.264149466030735e-09 - 1.264149466030735e-04 - 2.526984953580682e-04 - 2.521735549927725e-16 - 5.033500623385340e-16 - 1.004709971525236e-15 - - 2 1.180906969374945e-09 - -1.514801380340722e-09 - 1.514801380340722e-04 - 3.028004880113196e-04 - 3.078631347571166e-16 - 6.145090159683228e-16 - 1.226588337655132e-15 - - 3 1.542720908124834e-09 - -2.049689597483709e-09 - 2.049689597483709e-04 - 4.097115469383853e-04 - 4.437763676567463e-16 - 8.857978571714022e-16 - 1.768092896751413e-15 - - 4 2.266348785624612e-09 - -3.265760932995932e-09 - 3.265760932995932e-04 - 6.527287612098135e-04 - 9.397999789660777e-16 - 1.875866006928358e-15 - 3.744278902267733e-15 - - 5 3.713604540624168e-09 - -5.968710391500898e-09 - 5.968710391500899e-04 - 1.192640228419305e-03 - 4.345207513494314e-15 - 8.671579322257517e-15 - 1.730556654319970e-14 - - 6 6.608116050623280e-09 - -1.165754959289845e-08 - 1.165754959289845e-03 - 2.327838222854165e-03 - 5.642967340561880e-14 - 1.124945877057287e-13 - 2.242619207939039e-13 - - 7 1.179564303717826e-08 - -2.193530367475176e-08 - 2.193530367475176e-03 - 4.374658167824437e-03 - 9.992331799374361e-13 - 1.987384302704409e-12 - 3.952723001792399e-12 - - 8 2.217069701028822e-08 - -4.233554991551749e-08 - 4.233554991551749e-03 - 8.421454467083355e-03 - 2.567075209989195e-11 - 5.079257750506960e-11 - 1.004987167234087e-10 - - 9 4.292080495650814e-08 - -8.246787850423504e-08 - 8.246787850423504e-03 - 1.631955711542618e-02 - 7.429352627112179e-10 - 1.454666979009004e-09 - 2.848205166007601e-09 - - 10 6.747377244914711e-08 - -1.288241599365203e-07 - 1.288241599365203e-02 - 2.533540213098864e-02 - 6.016036906368960e-09 - 1.168438224023758e-08 - 2.269242430687209e-08 - - 11 1.027485608531171e-07 - -1.933367451151489e-07 - 1.933367451151489e-02 - 3.768347326653115e-02 - 4.547604757457383e-08 - 8.718365928170803e-08 - 1.671235294549662e-07 - - 12 1.550811172440954e-07 - -2.846833995746566e-07 - 2.846833995746566e-02 - 5.474832541420137e-02 - 3.375250800116866e-07 - 6.342555725437884e-07 - 1.191537432922743e-06 - - 13 2.124749343141491e-07 - -3.791439105081753e-07 - 3.791439105081753e-02 - 7.183486021773615e-02 - 1.485074359346451e-06 - 2.739473718610748e-06 - 5.050651248135159e-06 - - 14 2.934050742073026e-07 - -5.028277031417205e-07 - 5.028277031417205e-02 - 9.325941790944214e-02 - 6.951921938590966e-06 - 1.246646151568946e-05 - 2.233163733376972e-05 - - 15 3.899183279910254e-07 - -6.368485744692849e-07 - 6.368485744692850e-02 - 1.150948619702300e-01 - 2.649747455292758e-05 - 4.602250953893021e-05 - 7.978045912595374e-05 - - 16 5.093968731264188e-07 - -7.843833530131612e-07 - 7.843833530131612e-02 - 1.371850504655500e-01 - 9.207624151396878e-05 - 1.537740811662592e-04 - 2.559528885476014e-04 - - 17 6.489752711203596e-07 - -9.338518261925084e-07 - 9.338518261925084e-02 - 1.570273197910303e-01 - 2.792909973592655e-04 - 4.461073848024906e-04 - 7.086148431639843e-04 - - 18 8.223850555731352e-07 - -1.089864299179190e-06 - 1.089864299179190e-01 - 1.742648556363447e-01 - 8.126979446078827e-04 - 1.228244125338940e-03 - 1.839630830557003e-03 - - 19 1.039936620365588e-06 - -1.246638298441507e-06 - 1.246638298441507e-01 - 1.867092058644591e-01 - 2.285828604654097e-03 - 3.224697163278019e-03 - 4.483765996458879e-03 - - 20 1.319715872115905e-06 - -1.397349357516515e-06 - 1.397349357516515e-01 - 1.916979805788835e-01 - 6.317689492712388e-03 - 8.164324401851115e-03 - 1.030606900115141e-02 - - 21 1.686517899697324e-06 - -1.529891860605749e-06 - 1.529891860605749e-01 - 1.859565532106186e-01 - 1.718247093837089e-02 - 1.982736574760900e-02 - 2.201037442321020e-02 - - 22 2.186647083767628e-06 - -1.629428398181613e-06 - 1.629428398181613e-01 - 1.662034028698354e-01 - 4.642596629125201e-02 - 4.602451354215933e-02 - 4.268299343823448e-02 - - 23 2.786647083767628e-06 - -1.671982381159767e-06 - 1.671982381159767e-01 - 1.360832067083017e-01 - 1.086486529677349e-01 - 9.028520856351136e-02 - 6.680053659714552e-02 - - 24 3.386647083767628e-06 - -1.666708289319382e-06 - 1.666708289319382e-01 - 1.065961137297528e-01 - 2.019933895320813e-01 - 1.409501492585539e-01 - 8.111767734595639e-02 - - 25 3.986647083767628e-06 - -1.636239392733020e-06 - 1.636239392733020e-01 - 8.119800486443494e-02 - 3.221985296170131e-01 - 1.879090396235947e-01 - 8.016274379356519e-02 - - 26 4.586647083767628e-06 - -1.592958303223056e-06 - 1.592958303223056e-01 - 6.070506604262340e-02 - 4.601454482849191e-01 - 2.224246188905672e-01 - 6.424612709287120e-02 - - 27 5.186647083767628e-06 - -1.543623379945047e-06 - 1.543623379945047e-01 - 4.479678708109880e-02 - 6.043239691667113e-01 - 2.392201482511665e-01 - 3.780590619181199e-02 - - 28 5.786647083767628e-06 - -1.491907702045976e-06 - 1.491907702045976e-01 - 3.275072893014933e-02 - 7.431846280885604e-01 - 2.368781117682013e-01 - 6.852359091660139e-03 - - 29 6.386647083767628e-06 - -1.439792435778303e-06 - 1.439792435778303e-01 - 2.378169349328440e-02 - 8.668590173262367e-01 - 2.171478488724319e-01 - -2.306848179644787e-02 - - 30 6.986647083767627e-06 - -1.388331481824472e-06 - 1.388331481824472e-01 - 1.718228907053183e-02 - 9.681191419274604e-01 - 1.838077897422596e-01 - -4.796365600793339e-02 - - 31 7.586647083767627e-06 - -1.338071075679957e-06 - 1.338071075679957e-01 - 1.236766007539650e-02 - 1.042671016972224e+00 - 1.415321327946899e-01 - -6.566996968152291e-02 - - 32 8.186647083767628e-06 - -1.289280023988654e-06 - 1.289280023988654e-01 - 8.876981250123693e-03 - 1.088969089643156e+00 - 9.499362660424981e-02 - -7.562842047016014e-02 - - 33 8.786647083767628e-06 - -1.242076017350638e-06 - 1.242076017350638e-01 - 6.357881031810623e-03 - 1.107746658963011e+00 - 4.827333239307662e-02 - -7.843915471504923e-02 - - 34 9.386647083767627e-06 - -1.196494910292573e-06 - 1.196494910292573e-01 - 4.546231107047477e-03 - 1.101424879765328e+00 - 4.554708620525528e-03 - -7.538805789638806e-02 - - 35 9.986647083767627e-06 - -1.152528702498193e-06 - 1.152528702498193e-01 - 3.246760457659020e-03 - 1.073516666992439e+00 - -3.396212210108883e-02 - -6.804675773661231e-02 - - 36 1.058664708376763e-05 - -1.110146344414089e-06 - 1.110146344414089e-01 - 2.316517021036618e-03 - 1.028097189336683e+00 - -6.599874853245306e-02 - -5.798336364268095e-02 - - 37 1.118664708376763e-05 - -1.069305118106022e-06 - 1.069305118106022e-01 - 1.651595638606269e-03 - 9.693765313679967e-01 - -9.105384005235785e-02 - -4.658294889089031e-02 - - 38 1.178664708376763e-05 - -1.029956847083499e-06 - 1.029956847083499e-01 - 1.176870150147819e-03 - 9.013842949659325e-01 - -1.092246920089114e-01 - -3.495841677136451e-02 - - 39 1.238664708376763e-05 - -9.920512695316036e-07 - 9.920512695316036e-02 - 8.382359024086052e-04 - 8.277595463975323e-01 - -1.210283048726013e-01 - -2.392680475810324e-02 - - 40 1.298664708376763e-05 - -9.555378560684139e-07 - 9.555378560684139e-02 - 5.968428720504958e-04 - 7.516306562496196e-01 - -1.272418012047138e-01 - -1.402749198168676e-02 - - 41 1.358664708376763e-05 - -9.203667750735073e-07 - 9.203667750735073e-02 - 4.248571522307446e-04 - 6.755660933441945e-01 - -1.287717046055234e-01 - -5.563263673549205e-03 - - 42 1.418664708376763e-05 - -8.864893913817122e-07 - 8.864893913817122e-02 - 3.023712418928277e-04 - 6.015772305806626e-01 - -1.265545538806776e-01 - 1.349584122132374e-03 - - 43 1.478664708376763e-05 - -8.538585100266795e-07 - 8.538585100266795e-02 - 2.151653061229580e-04 - 5.311562150980697e-01 - -1.214869821570401e-01 - 6.731151169583247e-03 - - 44 1.538664708376763e-05 - -8.224284811671143e-07 - 8.224284811671143e-02 - 1.530922818134957e-04 - 4.653348807170765e-01 - -1.143810920904009e-01 - 1.069309216830403e-02 - - 45 1.598664708376763e-05 - -7.921552298901439e-07 - 7.921552298901439e-02 - 1.089168937368159e-04 - 4.047538335014330e-01 - -1.059400761361653e-01 - 1.340149806837349e-02 - - 46 1.658664708376763e-05 - -7.629962458090119e-07 - 7.629962458090119e-02 - 7.748311028005782e-05 - 3.497338006619688e-01 - -9.674904580077289e-02 - 1.504812104097493e-02 - - 47 1.718664708376763e-05 - -7.349105515804137e-07 - 7.349105515804137e-02 - 5.511827138234112e-05 - 3.003438820737499e-01 - -8.727655437525563e-02 - 1.582944868848389e-02 - - 48 1.778664708376763e-05 - -7.078586608014144e-07 - 7.078586608014144e-02 - 3.920723301882219e-05 - 2.564634021780585e-01 - -7.788305033150851e-02 - 1.593255151302921e-02 - - 49 1.838664708376763e-05 - -6.818025309915621e-07 - 6.818025309915621e-02 - 2.788835904166550e-05 - 2.178356320976079e-01 - -6.883330624805746e-02 - 1.552640761946806e-02 - - 50 1.898664708376763e-05 - -6.567055147578671e-07 - 6.567055147578671e-02 - 1.983668298288980e-05 - 1.841127879600602e-01 - -6.031062641991226e-02 - 1.475741378469763e-02 - - 51 1.958664708376763e-05 - -6.325323108102860e-07 - 6.325323108102860e-02 - 1.410934680022455e-05 - 1.548924830204021e-01 - -5.243129198065891e-02 - 1.374792257730501e-02 - - 52 2.018664708376763e-05 - -6.092489157117236e-07 - 6.092489157117236e-02 - 1.003548599883787e-05 - 1.297462940285003e-01 - -4.525823594528676e-02 - 1.259683280234207e-02 - - 53 2.078664708376763e-05 - -5.868225768176519e-07 - 5.868225768176519e-02 - 7.137810396578103e-06 - 1.082413673531994e-01 - -3.881335316739105e-02 - 1.138146154193364e-02 - - 54 2.138664708376763e-05 - -5.652217466261597e-07 - 5.652217466261597e-02 - 5.076773907606561e-06 - 8.995609902455238e-02 - -3.308815413377584e-02 - 1.016011499551744e-02 - - 55 2.198664708376763e-05 - -5.444160386317303e-07 - 5.444160386317303e-02 - 3.610835627798982e-06 - 7.449092524094347e-02 - -2.805268412856604e-02 - 8.974939299801216e-03 - - 56 2.258664708376763e-05 - -5.243761847070938e-07 - 5.243761847070938e-02 - 2.568179429164067e-06 - 6.147519509948855e-02 - -2.366276900703495e-02 - 7.854766820299426e-03 - - 57 2.318664708376763e-05 - -5.050739940006428e-07 - 5.050739940006428e-02 - 1.826590813882191e-06 - 5.057099452538205e-02 - -1.986573288373220e-02 - 6.817778296350529e-03 - - 58 2.378664708376763e-05 - -4.864823133176291e-07 - 4.864823133176291e-02 - 1.299139640224724e-06 - 4.147467043621487e-02 - -1.660477643856061e-02 - 5.873879622379742e-03 - - 59 2.438664708376763e-05 - -4.685749889436973e-07 - 4.685749889436973e-02 - 9.239944550735617e-07 - 3.391668122982992e-02 - -1.382221958359773e-02 - 5.026748086095437e-03 - - 60 2.498664708376763e-05 - -4.513268298648920e-07 - 4.513268298648920e-02 - 6.571766090561239e-07 - 2.766028273321528e-02 - -1.146180858163665e-02 - 4.275540948961647e-03 - - 61 2.558664708376763e-05 - -4.347135723367043e-07 - 4.347135723367043e-02 - 4.674059248624993e-07 - 2.249945299326918e-02 - -9.470272664280982e-03 - 3.616283467240179e-03 - - 62 2.618664708376763e-05 - -4.187118457546762e-07 - 4.187118457546762e-02 - 3.324343204742104e-07 - 1.825636722182948e-02 - -7.798294060677664e-03 - 3.042967402610447e-03 - - 63 2.678664708376763e-05 - -4.032991397798472e-07 - 4.032991397798472e-02 - 2.364379187533634e-07 - 1.477865648663428e-02 - -6.401031800939865e-03 - 2.548397723334224e-03 - - 64 2.738664708376763e-05 - -3.884537726735109e-07 - 3.884537726735109e-02 - 1.681620986362542e-07 - 1.193661985373132e-02 - -5.238316132556311e-03 - 2.124826894723649e-03 - - 65 2.798664708376763e-05 - -3.741548607971242e-07 - 3.741548607971242e-02 - 1.196021236620889e-07 - 9.620508435261841e-03 - -4.274608378947787e-03 - 1.764414688058854e-03 - - 66 2.858664708376763e-05 - -3.603822892346797e-07 - 3.603822892346797e-02 - 8.506472355827554e-08 - 7.737959636137384e-03 - -3.478801396862400e-03 - 1.459548113681114e-03 - - 67 2.918664708376763e-05 - -3.471166834963309e-07 - 3.471166834963309e-02 - 6.050063999733899e-08 - 6.211629169891409e-03 - -2.823918805423725e-03 - 1.203051836793585e-03 - - 68 2.978664708376763e-05 - -3.343393822635298e-07 - 3.343393822635298e-02 - 4.302990054439619e-08 - 4.977045512498984e-03 - -2.286756907007834e-03 - 9.883148941077680e-04 - - 69 3.000000000000000e-05 - -3.299106422685328e-07 - 3.299106422685328e-02 - 3.815817763877542e-08 - 4.599101705030142e-03 - -2.120719628045261e-03 - 9.210101886687262e-04 - diff --git a/test/defref.awk b/test/defref.awk new file mode 100644 index 00000000..b4e8f107 --- /dev/null +++ b/test/defref.awk @@ -0,0 +1 @@ +BEGIN { foo() } diff --git a/test/defref.ok b/test/defref.ok new file mode 100644 index 00000000..f833c961 --- /dev/null +++ b/test/defref.ok @@ -0,0 +1,2 @@ +gawk: defref.awk:2: warning: function `foo' called but never defined +gawk: defref.awk:1: fatal: function `foo' not defined diff --git a/test/fflush.ok b/test/fflush.ok new file mode 100644 index 00000000..4cf0df6c --- /dev/null +++ b/test/fflush.ok @@ -0,0 +1,16 @@ +1st +2nd +1st +2nd +1st +2nd +1st +2nd +1st +2nd +1st +2nd +1st +2nd +1st +2nd diff --git a/test/fflush.sh b/test/fflush.sh new file mode 100755 index 00000000..42d624c9 --- /dev/null +++ b/test/fflush.sh @@ -0,0 +1,16 @@ +#! /bin/sh +../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat"}' + +../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat"}'|cat + +../gawk 'BEGIN{print "1st";fflush("/dev/stdout");close("/dev/stdout");print "2nd"|"cat"}'|cat + +../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat + +../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat + +../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat + +../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"sort"}'|cat + +../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"sort";close("sort")}'|cat diff --git a/test/fieldwdth.good b/test/fieldwdth.ok index 51b40081..51b40081 100644 --- a/test/fieldwdth.good +++ b/test/fieldwdth.ok diff --git a/test/fldchg.awk b/test/fldchg.awk new file mode 100644 index 00000000..a8018f78 --- /dev/null +++ b/test/fldchg.awk @@ -0,0 +1,8 @@ +{ +# print "0:", $0 + gsub("aa", "+") + print "1:", $0 + $3 = "<" $3 ">" + print "2:", $0 + print "2a:" "%" $1 "%" $2 "%" $3 "%" $4 "%" $5 +} diff --git a/test/fldchg.in b/test/fldchg.in new file mode 100644 index 00000000..f500c36a --- /dev/null +++ b/test/fldchg.in @@ -0,0 +1 @@ +aa aab c d e f diff --git a/test/fldchg.ok b/test/fldchg.ok new file mode 100644 index 00000000..cc5032a8 --- /dev/null +++ b/test/fldchg.ok @@ -0,0 +1,3 @@ +1: + +b c d e f +2: + +b <c> d e f +2a:%+%+b%<c>%d%e diff --git a/test/fontdata.txt b/test/fontdata.txt deleted file mode 100644 index b2601237..00000000 --- a/test/fontdata.txt +++ /dev/null @@ -1,120 +0,0 @@ -@ -@ Data file for awk program genscrpt.awk which generates gulam -@ script for creation of bitmap TeX fonts. -@ Edit this file to your needs - each line starting with @ is ignored -@ unless it is in a form '@ fonts' or '@ magstep'. The rest should be quite -@ obvious. -@ -@ basic fonts - all magsteps -@ fonts -cmb10 -cmbx10 -cmbx5 -cmbx7 -cmcsc10 -cmex10 -cmmi10 -cmmi5 -cmmi7 -cmr10 -cmr5 -cmr7 -cmsl10 -cmss10 -cmssbx10 -cmsy10 -cmsy5 -cmsy7 -cmti10 -cmtt10 -@ magstep -0 0.5 1 2 3 4 5 -@ other fonts only in magsteps 0, 0.5 and 1 -@ fonts -cmbsy10 -cmbx12 -cmbx6 -cmbx7 -cmbx8 -cmbx9 -cmbxsl10 -cmbxti10 -cmdunh10 -cmff10 -cmfi10 -cmfib8 -cmitt10 -cmmi12 -cmmi6 -cmmi8 -cmmi9 -cmmib10 -cmr12 -cmr17 -cmr6 -cmr8 -cmr9 -cmsl12 -cmsl8 -cmsl9 -cmsltt10 -cmss12 -cmss17 -cmss8 -cmss9 -cmssdc10 -cmssi10 -cmssi12 -cmssi17 -cmssi8 -cmssi9 -cmssq8 -cmssqi8 -cmsy6 -cmsy8 -cmsy9 -cmtcsc10 -cmtex10 -cmtex8 -cmtex9 -cmti12 -cmti7 -cmti8 -cmti9 -cmtt12 -cmtt8 -cmtt9 -cmu10 -cmvtt10 -@ magstep -0 0.5 1 -@ specials -@ fonts -logo10 -@ magstep -0 0.5 1 -@ fonts -cminch -@ magstep -0 -@ LaTeX fonts -lasy10 -lasy5 -lasy7 -lasyb10 -@ magstep -0 0.5 1 2 3 4 5 -@ These fonts should not use cmbase -@ fonts -circle10 -circlew10 -line10 -linew10 -@ magstep -0 0.5 1 2 3 4 5 -@ fonts -lasy6 -lasy8 -lasy9 -@ magstep -0 0.5 1 diff --git a/test/fsbs.good b/test/fsbs.ok index 8d04f961..8d04f961 100644 --- a/test/fsbs.good +++ b/test/fsbs.ok diff --git a/test/fsrs.good b/test/fsrs.ok index 7dafd658..7dafd658 100644 --- a/test/fsrs.good +++ b/test/fsrs.ok diff --git a/test/fstabplus b/test/fstabplus.awk index 748a44f4..748a44f4 100644 --- a/test/fstabplus +++ b/test/fstabplus.awk diff --git a/test/fstabplus.good b/test/fstabplus.ok index 8d04f961..8d04f961 100644 --- a/test/fstabplus.good +++ b/test/fstabplus.ok diff --git a/test/gensub.awk b/test/gensub.awk new file mode 100644 index 00000000..33a2a5e4 --- /dev/null +++ b/test/gensub.awk @@ -0,0 +1,6 @@ +BEGIN { a = "this is a test of gawk" + b = gensub(/(this).*(test).*(gawk)/, "3 = <\\3>, 2 = <\\2>, 1 = <\\1>", 1, a) + print b +} +NR == 1 { print gensub(/b/, "BB", 2) } +NR == 2 { print gensub(/c/, "CC", "global") } diff --git a/test/gensub.in b/test/gensub.in new file mode 100644 index 00000000..96c9fafc --- /dev/null +++ b/test/gensub.in @@ -0,0 +1,2 @@ +a b c a b c a b c +a b c a b c a b c diff --git a/test/gensub.ok b/test/gensub.ok new file mode 100644 index 00000000..c909cd0d --- /dev/null +++ b/test/gensub.ok @@ -0,0 +1,3 @@ +3 = <gawk>, 2 = <test>, 1 = <this> +a b c a BB c a b c +a b CC a b CC a b CC diff --git a/test/getline.good b/test/getline.ok index 9b7f2b90..9b7f2b90 100644 --- a/test/getline.good +++ b/test/getline.ok diff --git a/test/gnureops.awk b/test/gnureops.awk new file mode 100644 index 00000000..15b9b841 --- /dev/null +++ b/test/gnureops.awk @@ -0,0 +1,45 @@ +# test the gnu regexp ops + +BEGIN { + if ("a rat is here" ~ /\yrat/) print "test 1 ok (\\y)" + else print "test 1 failed (\\y)" + if ("a rat is here" ~ /rat\y/) print "test 2 ok (\\y)" + else print "test 2 failed (\\y)" + if ("what a brat" !~ /\yrat/) print "test 3 ok (\\y)" + else print "test 3 failed (\\y)" + + if ("in the crate" ~ /\Brat/) print "test 4 ok (\\B)" + else print "test 4 failed (\\B)" + if ("a rat" !~ /\Brat/) print "test 5 ok (\\B)" + else print "test 5 failed (\\B)" + + if ("a word" ~ /\<word/) print "test 6 ok (\\<)" + else print "test 6 failed (\\<)" + if ("foreword" !~ /\<word/) print "test 7 ok (\\<)" + else print "test 7 failed (\\<)" + + if ("a word" ~ /word\>/) print "test 8 ok (\\>)" + else print "test 8 failed (\\\\>)" + if ("wordy" !~ /word\>/) print "test 9 ok (\\>)" + else print "test 9 failed (\\>)" + + if ("a" ~ /\w/) print "test 10 ok (\\w)" + else print "test 10 failed (\\\\w)" + if ("+" !~ /\w/) print "test 11 ok (\\w)" + else print "test 11 failed (\\w)" + + if ("a" !~ /\W/) print "test 12 ok (\\W)" + else print "test 12 failed (\\W)" + if ("+" ~ /\W/) print "test 13 ok (\\W)" + else print "test 13 failed (\\W)" + + if ("a" ~ /\`a/) print "test 14 ok (\\`)" + else print "test 14 failed (\\`)" + if ("b" !~ /\`a/) print "test 15 ok (\\`)" + else print "test 15 failed (\\`)" + + if ("a" ~ /a\'/) print "test 16 ok (\\')" + else print "test 16 failed (\\')" + if ("b" !~ /a\'/) print "test 17 ok (\\')" + else print "test 17 failed (\\')" +} diff --git a/test/gnureops.ok b/test/gnureops.ok new file mode 100644 index 00000000..0fb5f504 --- /dev/null +++ b/test/gnureops.ok @@ -0,0 +1,17 @@ +test 1 ok (\y) +test 2 ok (\y) +test 3 ok (\y) +test 4 ok (\B) +test 5 ok (\B) +test 6 ok (\<) +test 7 ok (\<) +test 8 ok (\>) +test 9 ok (\>) +test 10 ok (\w) +test 11 ok (\w) +test 12 ok (\W) +test 13 ok (\W) +test 14 ok (\`) +test 15 ok (\`) +test 16 ok (\') +test 17 ok (\') diff --git a/test/header.awk b/test/header.awk deleted file mode 100644 index 2066c829..00000000 --- a/test/header.awk +++ /dev/null @@ -1,5 +0,0 @@ -BEGIN{ - "date" | getline cur_time - close ("date") - print "This line printed on", cur_time -} diff --git a/test/igncfs.good b/test/igncfs.ok index 41df9a4c..41df9a4c 100644 --- a/test/igncfs.good +++ b/test/igncfs.ok diff --git a/test/ignrcase.good b/test/ignrcase.ok index d66e95ca..d66e95ca 100644 --- a/test/ignrcase.good +++ b/test/ignrcase.ok diff --git a/test/include.awk b/test/include.awk deleted file mode 100644 index a506a813..00000000 --- a/test/include.awk +++ /dev/null @@ -1,13 +0,0 @@ -# input file should have lines which start with "@incl" followed by -# a name of a file to include -{ - if ((NF == 2) && ($1 == "@incl")) { - print " -- included file -- ", $2 - while ((getline line < $2) > 0) - print line - close ($2) - printf "\t***\n" - } else { - print - } -} diff --git a/test/inftest.good b/test/inftest.ok index 83a93d01..83a93d01 100644 --- a/test/inftest.good +++ b/test/inftest.ok diff --git a/test/intprec.awk b/test/intprec.awk new file mode 100644 index 00000000..978e9eac --- /dev/null +++ b/test/intprec.awk @@ -0,0 +1 @@ +BEGIN { printf "%.10d:%.10x\n", 5, 14 } diff --git a/test/intprec.ok b/test/intprec.ok new file mode 100644 index 00000000..8783fac1 --- /dev/null +++ b/test/intprec.ok @@ -0,0 +1 @@ +0000000005:000000000e diff --git a/test/lastnpages b/test/lastnpages deleted file mode 100644 index 0acb7738..00000000 --- a/test/lastnpages +++ /dev/null @@ -1,47 +0,0 @@ -From nstn.ns.ca!news.cs.indiana.edu!news.nd.edu!spool.mu.edu!uunet!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!uw-beaver!fluke!ssc-vax!brennan Mon May 6 23:41:40 ADT 1991 -Article: 26492 of comp.unix.questions -Path: cs.dal.ca!nstn.ns.ca!news.cs.indiana.edu!news.nd.edu!spool.mu.edu!uunet!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!uw-beaver!fluke!ssc-vax!brennan -From: brennan@ssc-vax.UUCP (Michael D Brennan) -Newsgroups: comp.unix.questions -Subject: Re: How to print last <n> pages of a file -Message-ID: <3948@ssc-bee.ssc-vax.UUCP> -Date: 6 May 91 15:42:00 GMT -Article-I.D.: ssc-bee.3948 -Organization: Boeing Aerospace & Electronics, Seattle WA -Lines: 33 - - -The following shell & (new) awk program prints the last n pages. - -If you get more than 65 lines to a page, the program that inserts -the ^L's should be fixed. - -------------------------------------------------------------- -#!/bin/sh -# usage: lastpages -- prints 1 page reads stdin -# lastpages n -- prints n pages reads stdin -# lastpages n files -- prints n pages, reads file list - -program='BEGIN{RS = ORS = "\f" } - - -{ page[NR] = $0 - if ( NR > numpages ) delete page[NR-numpages] -} - -END { - i = NR - numpages + 1 - if ( i <= 0 ) i = 1 - - while( i <= NR ) print page[i++] -}' - - -case $# in -0) awk "$program" numpages=1 - ;; -1) awk "$program" numpages=$1 - ;; -*) pages=$1 ; shift - awk "$program" numpages=$pages $* ;; -esac - - diff --git a/test/litoct.awk b/test/litoct.awk new file mode 100644 index 00000000..5cfc1284 --- /dev/null +++ b/test/litoct.awk @@ -0,0 +1 @@ +{ if (/a\52b/) print "match" ; else print "no match" } diff --git a/test/litoct.ok b/test/litoct.ok new file mode 100644 index 00000000..4c0be978 --- /dev/null +++ b/test/litoct.ok @@ -0,0 +1 @@ +no match diff --git a/test/longwrds.good b/test/longwrds.ok index 01faa847..01faa847 100644 --- a/test/longwrds.good +++ b/test/longwrds.ok diff --git a/test/math.awk b/test/math.awk new file mode 100644 index 00000000..90a01dd8 --- /dev/null +++ b/test/math.awk @@ -0,0 +1,10 @@ +BEGIN { + pi = 3.1415927 + printf "cos(%f) = %f\n", pi/4, cos(pi/4) + printf "sin(%f) = %f\n", pi/4, sin(pi/4) + e = exp(1) + printf "e = %f\n", e + printf "log(e) = %f\n", log(e) + printf "sqrt(pi ^ 2) = %f\n", sqrt(pi ^ 2) + printf "atan2(1, 1) = %f\n", atan2(1, 1) +} diff --git a/test/math.ok b/test/math.ok new file mode 100644 index 00000000..a396a5b3 --- /dev/null +++ b/test/math.ok @@ -0,0 +1,6 @@ +cos(0.785398) = 0.707107 +sin(0.785398) = 0.707107 +e = 2.718282 +log(e) = 1.000000 +sqrt(pi ^ 2) = 3.141593 +atan2(1, 1) = 0.785398 diff --git a/test/negexp.good b/test/negexp.ok index 6e6566ce..6e6566ce 100644 --- a/test/negexp.good +++ b/test/negexp.ok diff --git a/test/nfset.good b/test/nfset.ok index 3ba48aec..3ba48aec 100644 --- a/test/nfset.good +++ b/test/nfset.ok diff --git a/test/noeffect.awk b/test/noeffect.awk new file mode 100644 index 00000000..b375a4c2 --- /dev/null +++ b/test/noeffect.awk @@ -0,0 +1,4 @@ +BEGIN { + s == "hello, world"; + print s +} diff --git a/test/noeffect.ok b/test/noeffect.ok new file mode 100644 index 00000000..b820ddf8 --- /dev/null +++ b/test/noeffect.ok @@ -0,0 +1,2 @@ +gawk: noeffect.awk:3: warning: statement may have no effect + diff --git a/test/nofmtch.awk b/test/nofmtch.awk new file mode 100644 index 00000000..2ea22492 --- /dev/null +++ b/test/nofmtch.awk @@ -0,0 +1 @@ +BEGIN { printf "%3\n" } diff --git a/test/nofmtch.ok b/test/nofmtch.ok new file mode 100644 index 00000000..e6f3846f --- /dev/null +++ b/test/nofmtch.ok @@ -0,0 +1,2 @@ +gawk: nofmtch.awk:1: warning: printf format specifier does not have control letter +%3 diff --git a/test/nonl.good b/test/nonl.ok index 24bd9b78..24bd9b78 100644 --- a/test/nonl.good +++ b/test/nonl.ok diff --git a/test/numfunc.awk b/test/numfunc.awk deleted file mode 100644 index de1d7a4d..00000000 --- a/test/numfunc.awk +++ /dev/null @@ -1,19 +0,0 @@ -BEGIN { - y = 8 - x = 1 - while (x < 256) { - print "arctan", y/x, atan2(y , x) - x += x - } - print "" - pi8 = atan2(1, 1) / 2 - arg = 0 - for (i = 0; i <= 8; i++) { - print "cos sin", arg, cos(arg), sin(arg) - arg += pi8 - } - print "" - for (i = -5; i<= 5; i++) { - print "exp log", i, exp(i), log(exp(i)) - } -} diff --git a/test/numsubstr.awk b/test/numsubstr.awk new file mode 100644 index 00000000..7a30993b --- /dev/null +++ b/test/numsubstr.awk @@ -0,0 +1 @@ +{ print substr(1000+$1, 2) } diff --git a/test/numsubstr.in b/test/numsubstr.in new file mode 100644 index 00000000..ac65c364 --- /dev/null +++ b/test/numsubstr.in @@ -0,0 +1,3 @@ +5000 +10000 +5000 diff --git a/test/numsubstr.ok b/test/numsubstr.ok new file mode 100644 index 00000000..86ec13ca --- /dev/null +++ b/test/numsubstr.ok @@ -0,0 +1,3 @@ +000 +1000 +000 diff --git a/test/out1.good b/test/out1.ok index f54b2b4d..f54b2b4d 100644 --- a/test/out1.good +++ b/test/out1.ok diff --git a/test/out2.good b/test/out2.ok index 66b7d2f7..66b7d2f7 100644 --- a/test/out2.good +++ b/test/out2.ok diff --git a/test/out3.good b/test/out3.ok index 7eb822ff..7eb822ff 100644 --- a/test/out3.good +++ b/test/out3.ok diff --git a/test/paramdup.good b/test/paramdup.ok index 0308cc8c..0308cc8c 100644 --- a/test/paramdup.good +++ b/test/paramdup.ok diff --git a/test/pcntplus.awk b/test/pcntplus.awk new file mode 100644 index 00000000..13999ac4 --- /dev/null +++ b/test/pcntplus.awk @@ -0,0 +1 @@ +BEGIN { printf "%+d %d\n", 3, 4 } diff --git a/test/pcntplus.ok b/test/pcntplus.ok new file mode 100644 index 00000000..b7902695 --- /dev/null +++ b/test/pcntplus.ok @@ -0,0 +1 @@ ++3 4 diff --git a/test/plus-minus b/test/plus-minus deleted file mode 100644 index 9fec4bff..00000000 --- a/test/plus-minus +++ /dev/null @@ -1,8 +0,0 @@ -{ - if ($1 == "-") - print "minus" - if ($1 == "+") - print "plus" - if (($1 != "-") && ($1 != "+")) - print "something else" -} diff --git a/test/posix b/test/posix.awk index 79474f30..79474f30 100755..100644 --- a/test/posix +++ b/test/posix.awk diff --git a/test/posix.good b/test/posix.ok index 100b1505..100b1505 100644 --- a/test/posix.good +++ b/test/posix.ok diff --git a/test/poundbang.good b/test/poundbang.ok index 143e28dd..143e28dd 100644 --- a/test/poundbang.good +++ b/test/poundbang.ok diff --git a/test/prmarscl.awk b/test/prmarscl.awk new file mode 100644 index 00000000..3caf3d9c --- /dev/null +++ b/test/prmarscl.awk @@ -0,0 +1,6 @@ +function test(a) +{ + print a[1] +} + +BEGIN { j = 4; test(j) } diff --git a/test/prmarscl.ok b/test/prmarscl.ok new file mode 100644 index 00000000..b42cee67 --- /dev/null +++ b/test/prmarscl.ok @@ -0,0 +1 @@ +gawk: prmarscl.awk:4: fatal: attempt to use scalar parameter 1 as an array diff --git a/test/prmreuse.awk b/test/prmreuse.awk new file mode 100644 index 00000000..37e06f59 --- /dev/null +++ b/test/prmreuse.awk @@ -0,0 +1,14 @@ +# from Pat Rankin, rankin@eql.caltech.edu + +BEGIN { dummy(1); legit(); exit } + +function dummy(arg) +{ + return arg +} + +function legit( scratch) +{ + split("1 2 3", scratch) + return "" +} diff --git a/test/prmreuse.ok b/test/prmreuse.ok new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/prmreuse.ok diff --git a/test/reparse.good b/test/reparse.ok index 6bdfacfa..6bdfacfa 100644 --- a/test/reparse.good +++ b/test/reparse.ok diff --git a/test/resplit.ok b/test/resplit.ok new file mode 100644 index 00000000..61780798 --- /dev/null +++ b/test/resplit.ok @@ -0,0 +1 @@ +b diff --git a/test/reverse.awk b/test/reverse.awk deleted file mode 100644 index c6b2e299..00000000 --- a/test/reverse.awk +++ /dev/null @@ -1,13 +0,0 @@ -#this program creates palindromic output - slightly modified from Gawk Manual -{ - rev($0, length) -} - -function rev(str, len) { - if (len == 0) { - print " ", $0 - return - } - printf "%c", substr(str, len, 1) - rev(str, len - 1) -} diff --git a/test/rs.data b/test/rs.in index edef835e..edef835e 100644 --- a/test/rs.data +++ b/test/rs.in diff --git a/test/rs.good b/test/rs.ok index 9dd6bd39..9dd6bd39 100644 --- a/test/rs.good +++ b/test/rs.ok diff --git a/test/rswhite.awk b/test/rswhite.awk new file mode 100644 index 00000000..00487656 --- /dev/null +++ b/test/rswhite.awk @@ -0,0 +1,2 @@ +BEGIN { RS = "" } +{ printf("<%s>\n", $0) } diff --git a/test/rswhite.in b/test/rswhite.in new file mode 100644 index 00000000..39f77564 --- /dev/null +++ b/test/rswhite.in @@ -0,0 +1,2 @@ + a b +c d diff --git a/test/rswhite.ok b/test/rswhite.ok new file mode 100644 index 00000000..a029e47f --- /dev/null +++ b/test/rswhite.ok @@ -0,0 +1,2 @@ +< a b +c d> diff --git a/test/sclforin.awk b/test/sclforin.awk new file mode 100644 index 00000000..335e8540 --- /dev/null +++ b/test/sclforin.awk @@ -0,0 +1 @@ +BEGIN { j = 4; for (i in j) print j[i] } diff --git a/test/sclforin.ok b/test/sclforin.ok new file mode 100644 index 00000000..d87fa61f --- /dev/null +++ b/test/sclforin.ok @@ -0,0 +1 @@ +gawk: sclforin.awk:1: fatal: attempt to use scalar as array diff --git a/test/sclifin.awk b/test/sclifin.awk new file mode 100644 index 00000000..64f5d0d3 --- /dev/null +++ b/test/sclifin.awk @@ -0,0 +1,7 @@ +BEGIN { + j = 4 + if ("foo" in j) + print "ouch" + else + print "ok" +} diff --git a/test/sclifin.ok b/test/sclifin.ok new file mode 100644 index 00000000..717f8368 --- /dev/null +++ b/test/sclifin.ok @@ -0,0 +1 @@ +gawk: sclifin.awk:7: fatal: attempt to use scalar as array diff --git a/test/splitargv.good b/test/splitargv.ok index 10886ef2..10886ef2 100644 --- a/test/splitargv.good +++ b/test/splitargv.ok diff --git a/test/sqrt.awk b/test/sqrt.awk deleted file mode 100644 index c9d8f512..00000000 --- a/test/sqrt.awk +++ /dev/null @@ -1,4 +0,0 @@ -BEGIN { - for (i = 0; i <= 25; i++) - printf "gawk sez -- square root of %2d is %15.12f\n", i, sqrt(i) -} diff --git a/test/strftime.ok b/test/strftime.ok new file mode 100644 index 00000000..52715bb9 --- /dev/null +++ b/test/strftime.ok @@ -0,0 +1 @@ +Thu Jan 11 09:35:20 EST 1996 diff --git a/test/data b/test/swaplns.in index 71fb1627..71fb1627 100644 --- a/test/data +++ b/test/swaplns.in diff --git a/test/swaplns.good b/test/swaplns.ok index d38b7caa..d38b7caa 100644 --- a/test/swaplns.good +++ b/test/swaplns.ok diff --git a/test/up_down.awk b/test/up_down.awk deleted file mode 100644 index 32ab847c..00000000 --- a/test/up_down.awk +++ /dev/null @@ -1,15 +0,0 @@ -{ - lim = split ($0, line) - out = "" - if (lim > 0) { - i = 0 - while (i < lim) { - i++ - if (i % 2) - out = out sprintf("%s ", toupper(line[i])) - else - out = out sprintf("%s ", tolower(line[i])) - } - } - print out -} diff --git a/test/zap_cpp.awk b/test/zap_cpp.awk deleted file mode 100644 index 99a5a1f4..00000000 --- a/test/zap_cpp.awk +++ /dev/null @@ -1,13 +0,0 @@ -# this will remove (comment out) all preprocessor traces from -# cpp produced files: -# run this awk program as follows -# awk -f zap_cpp.awk <file> -# end redirect output where you want it to -NF > 0 { - if ($1 ~ /^#/) - print "/*", $0, "*/" - else - print -} - - |