From 5d474d04c237a090e19d363c84a003cb0d83cb29 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 24 Jul 2016 21:50:28 +0300 Subject: Fix a typo in test/ChangeLog. --- test/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 8939b6f4..22a514b5 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,7 +1,7 @@ 2015-06-17 Arnold D. Robbins * Makefile.am (ofmtstrnum): New test. - * ofmtstrnu.awk, ofmtstrnum.ok: New files. + * ofmtstrnum.awk, ofmtstrnum.ok: New files. 2016-07-01 Arnold D. Robbins -- cgit v1.2.3 From 5da25619741b53c6f51dd86617f10591486477ae Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 1 Aug 2016 22:17:14 +0300 Subject: New test for sorted for. --- test/ChangeLog | 7 +++++++ test/Makefile.am | 5 ++++- test/Makefile.in | 10 +++++++++- test/Maketests | 5 +++++ test/sortfor2.awk | 11 +++++++++++ test/sortfor2.in | 2 ++ test/sortfor2.ok | 2 ++ 7 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 test/sortfor2.awk create mode 100644 test/sortfor2.in create mode 100644 test/sortfor2.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 22a514b5..89b5d177 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2016-08-01 Arnold D. Robbins + + * Makefile.am (sortfor2): New test. + * sortfor2.awk, sortfor2.in, sortfor2.ok: New files. + Thanks Christian Schneider + for the report. + 2015-06-17 Arnold D. Robbins * Makefile.am (ofmtstrnum): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 0bda377c..58b1057e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -911,6 +911,9 @@ EXTRA_DIST = \ sortfor.awk \ sortfor.in \ sortfor.ok \ + sortfor2.awk \ + sortfor2.in \ + sortfor2.ok \ sortglos.awk \ sortglos.in \ sortglos.ok \ @@ -1123,7 +1126,7 @@ GAWK_EXT_TESTS = \ profile0 profile1 profile2 profile3 profile4 profile5 profile6 \ profile7 profile8 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ - rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ + rsstart2 rsstart3 rstest6 shadow sortfor sortfor2 sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ symtab7 symtab8 symtab9 symtab10 \ diff --git a/test/Makefile.in b/test/Makefile.in index ff1d8e07..b04ac7c2 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1168,6 +1168,9 @@ EXTRA_DIST = \ sortfor.awk \ sortfor.in \ sortfor.ok \ + sortfor2.awk \ + sortfor2.in \ + sortfor2.ok \ sortglos.awk \ sortglos.in \ sortglos.ok \ @@ -1379,7 +1382,7 @@ GAWK_EXT_TESTS = \ profile0 profile1 profile2 profile3 profile4 profile5 profile6 \ profile7 profile8 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ - rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ + rsstart2 rsstart3 rstest6 shadow sortfor sortfor2 sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ symtab7 symtab8 symtab9 symtab10 \ @@ -3933,6 +3936,11 @@ sortfor: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +sortfor2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + sortu: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 7d50a4b3..c48b76df 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1317,6 +1317,11 @@ sortfor: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +sortfor2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + sortu: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/sortfor2.awk b/test/sortfor2.awk new file mode 100644 index 00000000..1dfca04f --- /dev/null +++ b/test/sortfor2.awk @@ -0,0 +1,11 @@ +BEGIN { + PROCINFO["sorted_in"] = "@ind_num_asc" + } + { + A[$1] = 0 + } + END { + for (I in A) B[I] = A[I] + for (I in B) SCRATCH = A[I] + for (I in A) print I + } diff --git a/test/sortfor2.in b/test/sortfor2.in new file mode 100644 index 00000000..e75357a1 --- /dev/null +++ b/test/sortfor2.in @@ -0,0 +1,2 @@ +1.0 +2.0 diff --git a/test/sortfor2.ok b/test/sortfor2.ok new file mode 100644 index 00000000..e75357a1 --- /dev/null +++ b/test/sortfor2.ok @@ -0,0 +1,2 @@ +1.0 +2.0 -- cgit v1.2.3 From 385636c3da7f36ae020eeb7098485923168ccf4b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 1 Aug 2016 22:39:33 +0300 Subject: Add test case for single byte IGNORECASE fix. --- test/ChangeLog | 6 ++++++ test/Makefile.am | 10 +++++++++- test/Makefile.in | 10 +++++++++- test/ignrcas3.awk | 20 ++++++++++++++++++++ test/ignrcas3.ok | 18 ++++++++++++++++++ 5 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 test/ignrcas3.awk create mode 100644 test/ignrcas3.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 89b5d177..a0f72bca 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -5,6 +5,12 @@ Thanks Christian Schneider for the report. + Unrelated: + + * Makefile.am (ignrcas3): New test. + * ignrcas3.awk, ignrcas3.ok: New files. + Based on test code from Norihiro Tanaka . + 2015-06-17 Arnold D. Robbins * Makefile.am (ofmtstrnum): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 58b1057e..fbaf23ea 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -443,6 +443,8 @@ EXTRA_DIST = \ igncfs.ok \ ignrcas2.awk \ ignrcas2.ok \ + ignrcas3.awk \ + ignrcas3.ok \ ignrcase.awk \ ignrcase.in \ ignrcase.ok \ @@ -1115,7 +1117,7 @@ GAWK_EXT_TESTS = \ fieldwdth fpat1 fpat2 fpat3 fpat4 fpat5 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ - icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ + icasefs icasers id igncdym igncfs ignrcas2 ignrcas3 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ @@ -2179,6 +2181,12 @@ symtab10: @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +ignrcas3:: + @echo $@ + @GAWKLOCALE=el_GR.iso88597 \ + AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index b04ac7c2..40da1e17 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -700,6 +700,8 @@ EXTRA_DIST = \ igncfs.ok \ ignrcas2.awk \ ignrcas2.ok \ + ignrcas3.awk \ + ignrcas3.ok \ ignrcase.awk \ ignrcase.in \ ignrcase.ok \ @@ -1371,7 +1373,7 @@ GAWK_EXT_TESTS = \ fieldwdth fpat1 fpat2 fpat3 fpat4 fpat5 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ - icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ + icasefs icasers id igncdym igncfs ignrcas2 ignrcas3 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ @@ -2617,6 +2619,12 @@ symtab10: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +ignrcas3:: + @echo $@ + @GAWKLOCALE=el_GR.iso88597 \ + AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: diff --git a/test/ignrcas3.awk b/test/ignrcas3.awk new file mode 100644 index 00000000..fd88744d --- /dev/null +++ b/test/ignrcas3.awk @@ -0,0 +1,20 @@ +BEGIN { + dfapat[1] = data[1] = "b\323" + dfapat[2] = data[2] = "b\362" + dfapat[3] = data[3] = "b\363" + + regexpat[1] = "[a-c]\323" + regexpat[2] = "[a-c]\362" + regexpat[3] = "[a-c]\363" + + IGNORECASE = 1 + + for (i = 1; i <= 3; i++) { + for (j = 1; j <= 3; j++) { + printf("data[%d] ~ dfa[%d] = %s\n", i, j, + data[i] ~ dfapat[j] ? "ok" : "bad") + printf("data[%d] ~ regex[%d] = %s\n", i, j, + data[i] ~ regexpat[j] ? "ok" : "bad") + } + } +} diff --git a/test/ignrcas3.ok b/test/ignrcas3.ok new file mode 100644 index 00000000..0222feb5 --- /dev/null +++ b/test/ignrcas3.ok @@ -0,0 +1,18 @@ +data[1] ~ dfa[1] = ok +data[1] ~ regex[1] = ok +data[1] ~ dfa[2] = ok +data[1] ~ regex[2] = ok +data[1] ~ dfa[3] = ok +data[1] ~ regex[3] = ok +data[2] ~ dfa[1] = ok +data[2] ~ regex[1] = ok +data[2] ~ dfa[2] = ok +data[2] ~ regex[2] = ok +data[2] ~ dfa[3] = ok +data[2] ~ regex[3] = ok +data[3] ~ dfa[1] = ok +data[3] ~ regex[1] = ok +data[3] ~ dfa[2] = ok +data[3] ~ regex[2] = ok +data[3] ~ dfa[3] = ok +data[3] ~ regex[3] = ok -- cgit v1.2.3