diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 10 | ||||
-rw-r--r-- | test/Makefile.am | 9 | ||||
-rw-r--r-- | test/Makefile.in | 19 | ||||
-rw-r--r-- | test/Maketests | 10 | ||||
-rw-r--r-- | test/ofmtstrnum.awk | 7 | ||||
-rw-r--r-- | test/ofmtstrnum.ok | 2 | ||||
-rw-r--r-- | test/status-close.awk | 14 | ||||
-rw-r--r-- | test/status-close.ok | 6 |
8 files changed, 73 insertions, 4 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 35b60f65..f18b562b 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,13 @@ +2016-07-23 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (status-close): New test. + * status-close.awk, status-close.ok: New files. + +2015-06-17 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (ofmtstrnum): New test. + * ofmtstrnu.awk, ofmtstrnum.ok: New files. + 2016-07-20 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (EXTRA_DIST): Remove clos1way6.ok2. diff --git a/test/Makefile.am b/test/Makefile.am index f884ba34..0c4e0113 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -728,6 +728,8 @@ EXTRA_DIST = \ ofmts.awk \ ofmts.in \ ofmts.ok \ + ofmtstrnum.awk \ + ofmtstrnum.ok \ ofs1.awk \ ofs1.in \ ofs1.ok \ @@ -1003,6 +1005,8 @@ EXTRA_DIST = \ sprintfc.awk \ sprintfc.in \ sprintfc.ok \ + status-close.awk \ + status-close.ok \ strcat1.awk \ strcat1.ok \ strftime.awk \ @@ -1167,7 +1171,8 @@ BASIC_TESTS = \ nasty nasty2 negexp negrange nested nfldstr nfloop nfneg nfset nlfldsep \ nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ noparms nors nulinsrc nulrsend numindex numsubstr \ - octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \ + octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofmtstrnum ofs1 onlynl \ + opasnidx opasnslf \ paramasfunc1 paramasfunc2 \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 printfchar prmarscl prmreuse \ @@ -1178,7 +1183,7 @@ BASIC_TESTS = \ reparse resplit rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sigpipe1 sortempty sortglos splitargv splitarr splitdef \ - splitvar splitwht strcat1 strnum1 strnum2 strtod subamp subback subi18n \ + splitvar splitwht status-close strcat1 strnum1 strnum2 strtod subamp subback subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \ diff --git a/test/Makefile.in b/test/Makefile.in index 45593f15..8c7ce31f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -985,6 +985,8 @@ EXTRA_DIST = \ ofmts.awk \ ofmts.in \ ofmts.ok \ + ofmtstrnum.awk \ + ofmtstrnum.ok \ ofs1.awk \ ofs1.in \ ofs1.ok \ @@ -1260,6 +1262,8 @@ EXTRA_DIST = \ sprintfc.awk \ sprintfc.in \ sprintfc.ok \ + status-close.awk \ + status-close.ok \ strcat1.awk \ strcat1.ok \ strftime.awk \ @@ -1423,7 +1427,8 @@ BASIC_TESTS = \ nasty nasty2 negexp negrange nested nfldstr nfloop nfneg nfset nlfldsep \ nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ noparms nors nulinsrc nulrsend numindex numsubstr \ - octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \ + octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofmtstrnum ofs1 onlynl \ + opasnidx opasnslf \ paramasfunc1 paramasfunc2 \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 printfchar prmarscl prmreuse \ @@ -1434,7 +1439,7 @@ BASIC_TESTS = \ reparse resplit rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sigpipe1 sortempty sortglos splitargv splitarr splitdef \ - splitvar splitwht strcat1 strnum1 strnum2 strtod subamp subback subi18n \ + splitvar splitwht status-close strcat1 strnum1 strnum2 strtod subamp subback subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \ @@ -3398,6 +3403,11 @@ ofmts: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +ofmtstrnum: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + ofs1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3665,6 +3675,11 @@ splitwht: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +status-close: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + strcat1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 4c85c44a..bfcb87cb 100644 --- a/test/Maketests +++ b/test/Maketests @@ -635,6 +635,11 @@ ofmts: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +ofmtstrnum: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + ofs1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -902,6 +907,11 @@ splitwht: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +status-close: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + strcat1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/ofmtstrnum.awk b/test/ofmtstrnum.awk new file mode 100644 index 00000000..805dad73 --- /dev/null +++ b/test/ofmtstrnum.awk @@ -0,0 +1,7 @@ +BEGIN { + split(" 1", f, "|") + OFMT = "%.1f" + print f[1] + x = f[1] + 0 + print f[1] +} diff --git a/test/ofmtstrnum.ok b/test/ofmtstrnum.ok new file mode 100644 index 00000000..ae955868 --- /dev/null +++ b/test/ofmtstrnum.ok @@ -0,0 +1,2 @@ + 1 + 1 diff --git a/test/status-close.awk b/test/status-close.awk new file mode 100644 index 00000000..345bea49 --- /dev/null +++ b/test/status-close.awk @@ -0,0 +1,14 @@ +BEGIN { + cat = "cat ; exit 3" + print system("echo xxx | (cat ; exit 4)") + + print "YYY" | cat + + print close(cat) + + echo = "echo boo ; exit 5" + echo | getline boo + print "got", boo + + print close(echo) +} diff --git a/test/status-close.ok b/test/status-close.ok new file mode 100644 index 00000000..ad3c0ce1 --- /dev/null +++ b/test/status-close.ok @@ -0,0 +1,6 @@ +xxx +4 +YYY +3 +got boo +5 |