diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-04-12 12:37:00 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-04-12 12:37:00 +0300 |
commit | c8d82e842e7ad94cae039e6c978b4bea1a31c4d5 (patch) | |
tree | b5da46c4c3e0f96683a42c6db5a32ea96aa854e3 /test | |
parent | 8f83ab76a1d8861d9a992290f2691443d5169c89 (diff) | |
download | egawk-c8d82e842e7ad94cae039e6c978b4bea1a31c4d5.tar.gz egawk-c8d82e842e7ad94cae039e6c978b4bea1a31c4d5.tar.bz2 egawk-c8d82e842e7ad94cae039e6c978b4bea1a31c4d5.zip |
Fix FPAT problems.
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 7 | ||||
-rw-r--r-- | test/Makefile.am | 7 | ||||
-rw-r--r-- | test/Makefile.in | 12 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/fpat6.awk | 8 | ||||
-rw-r--r-- | test/fpat6.in | 13 | ||||
-rw-r--r-- | test/fpat6.ok | 44 | ||||
-rw-r--r-- | test/patsplit.ok | 3 |
8 files changed, 95 insertions, 4 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index dd6b4cfb..ecac0519 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2017-04-12 Manuel Collado <m-collado@users.sourceforge.net> + + * Makefile.am (fpat6): New test. + * fpat6.awk, fpat6.in, fpat6.ok: New files. + Check for the bug reported by Ed Morton in the bug-gawk mailing list. + * patsplit.ok: Updated to the new patsplit behavior. + 2017-04-12 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (memleak): New test. diff --git a/test/Makefile.am b/test/Makefile.am index fe9b1dcc..7b1b4946 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -339,6 +339,9 @@ EXTRA_DIST = \ fpat5.awk \ fpat5.in \ fpat5.ok \ + fpat6.awk \ + fpat6.in \ + fpat6.ok \ fpatnull.awk \ fpatnull.in \ fpatnull.ok \ @@ -1227,8 +1230,8 @@ GAWK_EXT_TESTS = \ colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 clos1way6 \ crlf dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 delsub \ devfd devfd1 devfd2 dumpvars errno exit \ - fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpatnull fsfwfs funlen \ - functab1 functab2 functab3 fwtest fwtest2 fwtest3 fwtest4 \ + fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpat6 fpatnull \ + fsfwfs funlen functab1 functab2 functab3 fwtest fwtest2 fwtest3 fwtest4 \ genpot gensub gensub2 gensub3 getlndir gnuops2 gnuops3 gnureops gsubind \ icasefs icasers id igncdym igncfs ignrcas2 ignrcas4 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ diff --git a/test/Makefile.in b/test/Makefile.in index e6293e8d..bdfbdc82 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -597,6 +597,9 @@ EXTRA_DIST = \ fpat5.awk \ fpat5.in \ fpat5.ok \ + fpat6.awk \ + fpat6.in \ + fpat6.ok \ fpatnull.awk \ fpatnull.in \ fpatnull.ok \ @@ -1484,8 +1487,8 @@ GAWK_EXT_TESTS = \ colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 clos1way6 \ crlf dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 delsub \ devfd devfd1 devfd2 dumpvars errno exit \ - fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpatnull fsfwfs funlen \ - functab1 functab2 functab3 fwtest fwtest2 fwtest3 fwtest4 \ + fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpat6 fpatnull \ + fsfwfs funlen functab1 functab2 functab3 fwtest fwtest2 fwtest3 fwtest4 \ genpot gensub gensub2 gensub3 getlndir gnuops2 gnuops3 gnureops gsubind \ icasefs icasers id igncdym igncfs ignrcas2 ignrcas4 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ @@ -3966,6 +3969,11 @@ fpat5: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat6: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 4b765c9f..0c77f98a 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1142,6 +1142,11 @@ fpat5: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat6: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/fpat6.awk b/test/fpat6.awk new file mode 100644 index 00000000..de7824a4 --- /dev/null +++ b/test/fpat6.awk @@ -0,0 +1,8 @@ +BEGIN { + FPAT = "([^,]*)|(\"[^\"]+\")" +} +{ + print "NF =", NF + for (i = 1; i <= NF; i++) + printf("$%d = <%s>\n", i, $i) +} diff --git a/test/fpat6.in b/test/fpat6.in new file mode 100644 index 00000000..1924cd97 --- /dev/null +++ b/test/fpat6.in @@ -0,0 +1,13 @@ +,,3 +,,3 +,,a,,b,, +,,a,,b,, +"a",,"b" + + +"" +"" +xx +xx +, +, diff --git a/test/fpat6.ok b/test/fpat6.ok new file mode 100644 index 00000000..f9c393a1 --- /dev/null +++ b/test/fpat6.ok @@ -0,0 +1,44 @@ +NF = 3 +$1 = <> +$2 = <> +$3 = <3> +NF = 3 +$1 = <> +$2 = <> +$3 = <3> +NF = 7 +$1 = <> +$2 = <> +$3 = <a> +$4 = <> +$5 = <b> +$6 = <> +$7 = <> +NF = 7 +$1 = <> +$2 = <> +$3 = <a> +$4 = <> +$5 = <b> +$6 = <> +$7 = <> +NF = 3 +$1 = <"a"> +$2 = <> +$3 = <"b"> +NF = 0 +NF = 0 +NF = 1 +$1 = <""> +NF = 1 +$1 = <""> +NF = 1 +$1 = <xx> +NF = 1 +$1 = <xx> +NF = 2 +$1 = <> +$2 = <> +NF = 2 +$1 = <> +$2 = <> diff --git a/test/patsplit.ok b/test/patsplit.ok index cda8319e..02387d86 100644 --- a/test/patsplit.ok +++ b/test/patsplit.ok @@ -8,6 +8,7 @@ seps[0] = <> seps[1] = <,> seps[2] = <,> seps[3] = <,> +seps[4] = <> Splitting: <Smith,,"1234 A Pretty Place, NE",Sometown,NY,12345-6789,USA> n = 7 fields[1] = <Smith> @@ -24,6 +25,7 @@ seps[3] = <,> seps[4] = <,> seps[5] = <,> seps[6] = <,> +seps[7] = <> Splitting: <Robbins,Arnold,"1234 A Pretty Place, NE",Sometown,NY,12345-6789,USA> n = 7 fields[1] = <Robbins> @@ -40,6 +42,7 @@ seps[3] = <,> seps[4] = <,> seps[5] = <,> seps[6] = <,> +seps[7] = <> Splitting: <bbbaaacccdddaaaaaqqqq> n = 2 fields[1] = <aaa> |