diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 17 | ||||
-rw-r--r-- | test/Makefile.am | 12 | ||||
-rw-r--r-- | test/Makefile.in | 17 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/mixed1.ok | 4 | ||||
-rw-r--r-- | test/subback.awk | 16 | ||||
-rw-r--r-- | test/subback.in | 1 | ||||
-rw-r--r-- | test/subback.ok | 12 |
8 files changed, 76 insertions, 8 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 49ad457e..5f2d683f 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,20 @@ +2016-06-14 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (subback): New test. + * subback.awk, subback.in, subback.ok: New files. + Thanks to Mike Brennan for the test. + + Unrelated: + + * Makefile.am (FAIL_CODE1): Update the list. + +2016-06-14 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (GAWK_EXT_TESTS): Add mixed1. Who knows + how long that's been broken... + * mixed1.ok: Adjust to match what the code produces. + Thanks to John E. Malmberg <wb8tyw@qsl.net> for the report. + 2016-06-08 Arnold D. Robbins <arnold@skeeve.com> * symtab10.awk, symtab10.in, symtab10.ok: New files. diff --git a/test/Makefile.am b/test/Makefile.am index 9d95a609..7ec75508 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -985,6 +985,9 @@ EXTRA_DIST = \ subamp.awk \ subamp.in \ subamp.ok \ + subback.awk \ + subback.in \ + subback.ok \ subi18n.awk \ subi18n.ok \ subsepnm.awk \ @@ -1138,7 +1141,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 strtod subamp subi18n \ + splitvar splitwht strcat1 strnum1 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 \ @@ -1161,7 +1164,7 @@ GAWK_EXT_TESTS = \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ - manyfiles match1 match2 match3 mbstr1 mbstr2 \ + mixed1 manyfiles match1 match2 match3 mbstr1 mbstr2 \ muldimposix \ nastyparm negtime next nondec nondec2 \ nonfatal1 nonfatal2 nonfatal3 \ @@ -1206,7 +1209,10 @@ NEED_LINT_OLD = lintold # List of the tests which fail with EXIT CODE 1 FAIL_CODE1 = \ - fnarray2 fnmisc gsubasgn mixed1 noparms paramdup synerr1 synerr2 unterm + badassign1 badbuild callparam delfunc fcall_exit fcall_exit2 \ + fnamedat fnarray fnarray2 fnasgnm fnmisc funsmnam gsubasgn \ + incdupe2 lintwarn match2 mixed1 noparms paramasfunc1 paramasfunc2 \ + paramdup paramres parseme readbuf synerr1 synerr2 unterm # List of files which have .ok versions for MPFR CHECK_MPFR = \ diff --git a/test/Makefile.in b/test/Makefile.in index 67fc7b45..dda34978 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1242,6 +1242,9 @@ EXTRA_DIST = \ subamp.awk \ subamp.in \ subamp.ok \ + subback.awk \ + subback.in \ + subback.ok \ subi18n.awk \ subi18n.ok \ subsepnm.awk \ @@ -1394,7 +1397,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 strtod subamp subi18n \ + splitvar splitwht strcat1 strnum1 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 \ @@ -1417,7 +1420,7 @@ GAWK_EXT_TESTS = \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ - manyfiles match1 match2 match3 mbstr1 mbstr2 \ + mixed1 manyfiles match1 match2 match3 mbstr1 mbstr2 \ muldimposix \ nastyparm negtime next nondec nondec2 \ nonfatal1 nonfatal2 nonfatal3 \ @@ -1461,7 +1464,10 @@ NEED_LINT_OLD = lintold # List of the tests which fail with EXIT CODE 1 FAIL_CODE1 = \ - fnarray2 fnmisc gsubasgn mixed1 noparms paramdup synerr1 synerr2 unterm + badassign1 badbuild callparam delfunc fcall_exit fcall_exit2 \ + fnamedat fnarray fnarray2 fnasgnm fnmisc funsmnam gsubasgn \ + incdupe2 lintwarn match2 mixed1 noparms paramasfunc1 paramasfunc2 \ + paramdup paramres parseme readbuf synerr1 synerr2 unterm # List of files which have .ok versions for MPFR @@ -3597,6 +3603,11 @@ strtod: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +subback: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + subsepnm: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 0877ea86..59ff889a 100644 --- a/test/Maketests +++ b/test/Maketests @@ -897,6 +897,11 @@ strtod: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +subback: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + subsepnm: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/mixed1.ok b/test/mixed1.ok index 91608fa3..bd6f447d 100644 --- a/test/mixed1.ok +++ b/test/mixed1.ok @@ -1,3 +1,3 @@ -gawk: BEGIN {return junk} -gawk: ^ `return' used outside function context +gawk: cmd. line:1: BEGIN {return junk} +gawk: cmd. line:1: ^ `return' used outside function context EXIT CODE: 1 diff --git a/test/subback.awk b/test/subback.awk new file mode 100644 index 00000000..d91513c1 --- /dev/null +++ b/test/subback.awk @@ -0,0 +1,16 @@ +BEGIN { + A[0] = "&" + for(i=1;i<=11;i++) { + A[i] = "\\" A[i-1] + } +## A[] holds & \& \\& \\\& \\\\& ... +} + +{ + for(i=0; i <= 11 ; i++) { + x = $0 + sub(/B/, A[i], x) + y = gensub(/B/, A[i], "1", $0) + print i, x, y + } +} diff --git a/test/subback.in b/test/subback.in new file mode 100644 index 00000000..223b7836 --- /dev/null +++ b/test/subback.in @@ -0,0 +1 @@ +B diff --git a/test/subback.ok b/test/subback.ok new file mode 100644 index 00000000..9792c82b --- /dev/null +++ b/test/subback.ok @@ -0,0 +1,12 @@ +0 B B +1 & & +2 \B \B +3 \& \& +4 \\B \\B +5 \\& \\& +6 \\\B \\\B +7 \\\& \\\& +8 \\\\B \\\\B +9 \\\\& \\\\& +10 \\\\\B \\\\\B +11 \\\\\& \\\\\& |