diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 10 | ||||
-rw-r--r-- | test/Makefile.am | 12 | ||||
-rw-r--r-- | test/Makefile.in | 22 | ||||
-rw-r--r-- | test/Maketests | 10 | ||||
-rw-r--r-- | test/modifiers.ok | 12 | ||||
-rwxr-xr-x | test/modifiers.sh | 8 | ||||
-rw-r--r-- | test/rsnullre.awk | 5 | ||||
-rw-r--r-- | test/rsnullre.in | 1 | ||||
-rw-r--r-- | test/rsnullre.ok | 3 |
9 files changed, 77 insertions, 6 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 7d373146..456af38a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,13 @@ +2021-01-07 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (EXTRA_DIST): modifiers, new test. + * modifiers.sh, modifiers.ok: New files. + + Unrelated: + + * Makefile.am (EXTRA_DIST): rsnullre, new test. + * rsnullre.awk, rsnullre.in, rsnullre.ok: New files. + 2020-12-26 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (EXTRA_DIST): fpat9, new test. diff --git a/test/Makefile.am b/test/Makefile.am index 2b1f1416..09efe0eb 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -661,6 +661,8 @@ EXTRA_DIST = \ manglprm.ok \ manyfiles.awk \ manyfiles.ok \ + modifiers.sh \ + modifiers.ok \ muldimposix.awk \ muldimposix.ok \ match1.awk \ @@ -1098,6 +1100,9 @@ EXTRA_DIST = \ rsnul1nl.ok \ rsnulbig.ok \ rsnulbig2.ok \ + rsnullre.awk \ + rsnullre.in \ + rsnullre.ok \ rsnulw.awk \ rsnulw.in \ rsnulw.ok \ @@ -1402,7 +1407,7 @@ BASIC_TESTS = \ printf1 printfchar prmarscl prmreuse prt1eval prtoeval \ rand randtest range1 range2 readbuf rebrackloc rebt8b1 rebuild redfilnm regeq \ regexpbrack regexpbrack2 regexprange regrange reindops reparse resplit \ - rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rsnulw \ + rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rsnullre rsnulw \ rstest1 rstest2 rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin setrec0 setrec1 \ sigpipe1 sortempty sortglos spacere splitargv splitarr \ @@ -1436,7 +1441,8 @@ GAWK_EXT_TESTS = \ indirectbuiltin indirectcall indirectcall2 inf-nan-torture \ intarray iolint isarrayunset \ lint lintexp lintindex lintint lintlength lintplus lintold lintset lintwarn \ - manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime muldimposix \ + manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime \ + modifiers muldimposix \ nastyparm negtime next nondec nondec2 nonfatal1 nonfatal2 nonfatal3 \ nsawk1a nsawk1b nsawk1c nsawk2a nsawk2b \ nsbad nsbad_cmd nsforloop nsfuncrecurse nsindirect1 nsindirect2 nsprof1 nsprof2 \ @@ -1518,7 +1524,7 @@ NEED_SANDBOX = sandbox1 NEED_TRADITIONAL = litoct tradanch rscompat # Lists of tests that run a shell script -RUN_SHELL = exit fflush localenl next randtest rtlen rtlen01 +RUN_SHELL = exit fflush localenl modifiers next randtest rtlen rtlen01 # List of the tests which fail with EXIT CODE 1 FAIL_CODE1 = \ diff --git a/test/Makefile.in b/test/Makefile.in index b96b7d0d..54d4a114 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -924,6 +924,8 @@ EXTRA_DIST = \ manglprm.ok \ manyfiles.awk \ manyfiles.ok \ + modifiers.sh \ + modifiers.ok \ muldimposix.awk \ muldimposix.ok \ match1.awk \ @@ -1361,6 +1363,9 @@ EXTRA_DIST = \ rsnul1nl.ok \ rsnulbig.ok \ rsnulbig2.ok \ + rsnullre.awk \ + rsnullre.in \ + rsnullre.ok \ rsnulw.awk \ rsnulw.in \ rsnulw.ok \ @@ -1665,7 +1670,7 @@ BASIC_TESTS = \ printf1 printfchar prmarscl prmreuse prt1eval prtoeval \ rand randtest range1 range2 readbuf rebrackloc rebt8b1 rebuild redfilnm regeq \ regexpbrack regexpbrack2 regexprange regrange reindops reparse resplit \ - rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rsnulw \ + rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rsnullre rsnulw \ rstest1 rstest2 rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin setrec0 setrec1 \ sigpipe1 sortempty sortglos spacere splitargv splitarr \ @@ -1699,7 +1704,8 @@ GAWK_EXT_TESTS = \ indirectbuiltin indirectcall indirectcall2 inf-nan-torture \ intarray iolint isarrayunset \ lint lintexp lintindex lintint lintlength lintplus lintold lintset lintwarn \ - manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime muldimposix \ + manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime \ + modifiers muldimposix \ nastyparm negtime next nondec nondec2 nonfatal1 nonfatal2 nonfatal3 \ nsawk1a nsawk1b nsawk1c nsawk2a nsawk2b \ nsbad nsbad_cmd nsforloop nsfuncrecurse nsindirect1 nsindirect2 nsprof1 nsprof2 \ @@ -1781,7 +1787,7 @@ NEED_SANDBOX = sandbox1 NEED_TRADITIONAL = litoct tradanch rscompat # Lists of tests that run a shell script -RUN_SHELL = exit fflush localenl next randtest rtlen rtlen01 +RUN_SHELL = exit fflush localenl modifiers next randtest rtlen rtlen01 # List of the tests which fail with EXIT CODE 1 FAIL_CODE1 = \ @@ -3883,6 +3889,11 @@ rsnul1nl: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +rsnullre: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + rsnulw: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -4637,6 +4648,11 @@ mktime: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +modifiers: + @echo $@ + @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + muldimposix: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 363a2755..87b141b4 100644 --- a/test/Maketests +++ b/test/Maketests @@ -965,6 +965,11 @@ rsnul1nl: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +rsnullre: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + rsnulw: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1719,6 +1724,11 @@ mktime: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +modifiers: + @echo $@ + @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + muldimposix: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/modifiers.ok b/test/modifiers.ok new file mode 100644 index 00000000..77854331 --- /dev/null +++ b/test/modifiers.ok @@ -0,0 +1,12 @@ +gawk: cmd. line:1: warning: `h' is meaningless in awk formats; ignored +gawk: cmd. line:1: fatal: `h' is not permitted in POSIX awk formats +gawk: cmd. line:1: warning: `l' is meaningless in awk formats; ignored +gawk: cmd. line:1: fatal: `l' is not permitted in POSIX awk formats +gawk: cmd. line:1: warning: `L' is meaningless in awk formats; ignored +gawk: cmd. line:1: fatal: `L' is not permitted in POSIX awk formats +gawk: cmd. line:1: warning: `j' is meaningless in awk formats; ignored +gawk: cmd. line:1: fatal: `j' is not permitted in POSIX awk formats +gawk: cmd. line:1: warning: `t' is meaningless in awk formats; ignored +gawk: cmd. line:1: fatal: `t' is not permitted in POSIX awk formats +gawk: cmd. line:1: warning: `z' is meaningless in awk formats; ignored +gawk: cmd. line:1: fatal: `z' is not permitted in POSIX awk formats diff --git a/test/modifiers.sh b/test/modifiers.sh new file mode 100755 index 00000000..07b95686 --- /dev/null +++ b/test/modifiers.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +AWK=${AWK:-../gawk} +for modifier in h l L j t z +do + $AWK -v let=$modifier --posix --lint 'BEGIN { printf "%" let "u\n", 12 }' +done +exit 0 diff --git a/test/rsnullre.awk b/test/rsnullre.awk new file mode 100644 index 00000000..72b156f2 --- /dev/null +++ b/test/rsnullre.awk @@ -0,0 +1,5 @@ +BEGIN { + RS = "()" +} + +{ printf("<<%s>>\n", $0) ; printf("<%s>\n", RT) } diff --git a/test/rsnullre.in b/test/rsnullre.in new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/test/rsnullre.in @@ -0,0 +1 @@ +foo diff --git a/test/rsnullre.ok b/test/rsnullre.ok new file mode 100644 index 00000000..e8f34942 --- /dev/null +++ b/test/rsnullre.ok @@ -0,0 +1,3 @@ +<<foo +>> +<> |