diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 7 | ||||
-rw-r--r-- | test/Makefile.am | 13 | ||||
-rw-r--r-- | test/Makefile.in | 24 | ||||
-rw-r--r-- | test/Maketests | 11 | ||||
-rw-r--r-- | test/typeof6.awk | 46 | ||||
-rw-r--r-- | test/typeof6.ok | 1 |
6 files changed, 94 insertions, 8 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 4fab85b2..eb264148 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2021-09-06 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (EXTRA_DIST): typeof6, new test. + * typeof6.awk, typeof6.ok: New files. + * Makefile.am (EXTRA_DIST): commas, new test. + * commas.awk, commas.ok: New files. + 2021-08-13 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (EXTRA_DIST): regexsub, new test. diff --git a/test/Makefile.am b/test/Makefile.am index 94dba463..d9d3861b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -197,6 +197,9 @@ EXTRA_DIST = \ colonwarn.awk \ colonwarn.in \ colonwarn.ok \ + commas.awk \ + commas.in \ + commas.ok \ compare.awk \ compare.in \ compare.ok \ @@ -1331,6 +1334,8 @@ EXTRA_DIST = \ typeof5.awk \ typeof5.in \ typeof5.ok \ + typeof6.awk \ + typeof6.ok \ uninit2.awk \ uninit2.ok \ uninit3.awk \ @@ -1437,7 +1442,7 @@ GAWK_EXT_TESTS = \ arraytype asortbool \ backw badargs beginfile1 beginfile2 binmode1 \ charasbytes colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 \ - clos1way6 crlf \ + clos1way6 commas crlf \ dbugeval dbugeval2 dbugeval3 dbugtypedre1 dbugtypedre2 delsub \ devfd devfd1 devfd2 dfacheck1 dumpvars \ errno exit fieldwdth forcenum \ @@ -1470,7 +1475,7 @@ GAWK_EXT_TESTS = \ symtab8 symtab9 symtab10 symtab11 \ timeout typedregex1 typedregex2 typedregex3 typedregex4 \ typedregex5 typedregex6 \ - typeof1 typeof2 typeof3 typeof4 typeof5 \ + typeof1 typeof2 typeof3 typeof4 typeof5 typeof6 \ watchpoint1 ARRAYDEBUG_TESTS = arrdbg @@ -1548,12 +1553,12 @@ NEED_LOCALE_C = \ clos1way gsubtst6 range2 NEED_LOCALE_EN = \ - backbigs1 backsmalls1 backsmalls2 concat4 dfamb1 ignrcas2 lc_num1 \ + backbigs1 backsmalls1 backsmalls2 commas concat4 dfamb1 ignrcas2 lc_num1 \ mbfw1 mbprintf1 mbprintf3 mbprintf4 mbstr1 mbstr2 posix_compare \ printhuge reint2 rri1 subamp subi18n wideidx wideidx2 \ widesub widesub2 widesub3 widesub4 -# Unused at the moment, since nlstringtest has additional stufff it does +# Unused at the moment, since nlstringtest has additional stuff it does # NEED_LOCALE_FR = # Same for ignrcas3 # NEED_LOCALE_GR = diff --git a/test/Makefile.in b/test/Makefile.in index 18ccdfcb..3892de69 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -460,6 +460,9 @@ EXTRA_DIST = \ colonwarn.awk \ colonwarn.in \ colonwarn.ok \ + commas.awk \ + commas.in \ + commas.ok \ compare.awk \ compare.in \ compare.ok \ @@ -1594,6 +1597,8 @@ EXTRA_DIST = \ typeof5.awk \ typeof5.in \ typeof5.ok \ + typeof6.awk \ + typeof6.ok \ uninit2.awk \ uninit2.ok \ uninit3.awk \ @@ -1700,7 +1705,7 @@ GAWK_EXT_TESTS = \ arraytype asortbool \ backw badargs beginfile1 beginfile2 binmode1 \ charasbytes colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 \ - clos1way6 crlf \ + clos1way6 commas crlf \ dbugeval dbugeval2 dbugeval3 dbugtypedre1 dbugtypedre2 delsub \ devfd devfd1 devfd2 dfacheck1 dumpvars \ errno exit fieldwdth forcenum \ @@ -1733,7 +1738,7 @@ GAWK_EXT_TESTS = \ symtab8 symtab9 symtab10 symtab11 \ timeout typedregex1 typedregex2 typedregex3 typedregex4 \ typedregex5 typedregex6 \ - typeof1 typeof2 typeof3 typeof4 typeof5 \ + typeof1 typeof2 typeof3 typeof4 typeof5 typeof6 \ watchpoint1 ARRAYDEBUG_TESTS = arrdbg @@ -1812,13 +1817,13 @@ NEED_LOCALE_C = \ clos1way gsubtst6 range2 NEED_LOCALE_EN = \ - backbigs1 backsmalls1 backsmalls2 concat4 dfamb1 ignrcas2 lc_num1 \ + backbigs1 backsmalls1 backsmalls2 commas concat4 dfamb1 ignrcas2 lc_num1 \ mbfw1 mbprintf1 mbprintf3 mbprintf4 mbstr1 mbstr2 posix_compare \ printhuge reint2 rri1 subamp subi18n wideidx wideidx2 \ widesub widesub2 widesub3 widesub4 -# Unused at the moment, since nlstringtest has additional stufff it does +# Unused at the moment, since nlstringtest has additional stuff it does # NEED_LOCALE_FR = # Same for ignrcas3 # NEED_LOCALE_GR = @@ -4309,6 +4314,12 @@ clos1way6: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +commas: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; export GAWKLOCALE; \ + AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + crlf: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -5049,6 +5060,11 @@ typeof5: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +typeof6: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + double1: @echo $@ $(ZOS_FAIL) @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index ac6c98b6..01d57db7 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1371,6 +1371,12 @@ clos1way6: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +commas: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; export GAWKLOCALE; \ + AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + crlf: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -2111,6 +2117,11 @@ typeof5: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +typeof6: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + double1: @echo $@ $(ZOS_FAIL) @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/typeof6.awk b/test/typeof6.awk new file mode 100644 index 00000000..a1988c18 --- /dev/null +++ b/test/typeof6.awk @@ -0,0 +1,46 @@ + +BEGIN{ + + A[ "any index" ] = 1 # any number + + for ( i in A ) { + + v = A[ i ] + + gensub( /^/, "1", 1, v ) + + #gsub( /^dfsdfs/, "1", v ) + + #sub( /^/, "1", v ) + + if ( typeof( A[ i ] ) == "unknown" ) + + print "ERROR: A[ " i " ] == " A[ i ] "'" } + + v = A[ "any index" ] + + print typeof( v ) + + } + + + +# GNU Awk 5.1.0, API: 3.0 (GNU MPFR 3.1.5, GNU MP 6.1.2) +# Copyright (C) 1989, 1991-2020 Free Software Foundation. +# +# Windows 10x64 +# +# here is the typeof() error reproducing script +# it is actual for: gensub(), gsub() and sub() built-ins +# +# please pay attention that: v = A[ i ] is doesn't matter +# you may apply built-ins at A[ i ] directly with the same +# result +# +# with Respect +# +# Denis Shirokov (2021.9.5) + + + + diff --git a/test/typeof6.ok b/test/typeof6.ok new file mode 100644 index 00000000..b67e17ae --- /dev/null +++ b/test/typeof6.ok @@ -0,0 +1 @@ +number |