From 0e829ea9a5062cac730f5a8368ab2062c1ef67fd Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 14 Jan 2015 19:51:49 +0200 Subject: Remove deferred variables. --- test/ChangeLog | 4 ++++ test/dumpvars.ok | 2 ++ test/id.ok | 1 + 3 files changed, 7 insertions(+) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 2cc88514..16ef6d56 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2015-01-14 Arnold D. Robbins + + * dumpvars.ok, id.ok: Updated after code changes. + 2015-01-07 Arnold D. Robbins * Makefile.am (regexpbrack): New test. diff --git a/test/dumpvars.ok b/test/dumpvars.ok index 73d3d306..5013b351 100644 --- a/test/dumpvars.ok +++ b/test/dumpvars.ok @@ -3,6 +3,7 @@ ARGIND: 0 ARGV: array, 1 elements BINMODE: 0 CONVFMT: "%.6g" +ENVIRON: array, 57 elements ERRNO: "" FIELDWIDTHS: "" FILENAME: "-" @@ -17,6 +18,7 @@ OFMT: "%.6g" OFS: " " ORS: "\n" PREC: 53 +PROCINFO: array, 28 elements RLENGTH: 0 ROUNDMODE: "N" RS: "\n" diff --git a/test/id.ok b/test/id.ok index a9f540e7..a3271cff 100644 --- a/test/id.ok +++ b/test/id.ok @@ -70,3 +70,4 @@ lshift -> builtin SYMTAB -> array strtonum -> builtin toupper -> builtin +ENVIRON -> array -- cgit v1.2.3 From 16d6377af8d1683a29b9dc7d7ab3e8d4bc1ebd48 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 14 Jan 2015 20:50:00 +0200 Subject: Fix dumpvars test after removing deferred variables. --- test/ChangeLog | 2 ++ test/Makefile.am | 2 +- test/Makefile.in | 2 +- test/dumpvars.ok | 2 -- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 16ef6d56..04e65b5a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,5 +1,7 @@ 2015-01-14 Arnold D. Robbins + * Makefile.am (dumpvars): Grep out ENVIRON and PROCINFO since + those can be different depending on who runs the test. * dumpvars.ok, id.ok: Updated after code changes. 2015-01-07 Arnold D. Robbins diff --git a/test/Makefile.am b/test/Makefile.am index 12bde88d..bd2903ab 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1679,7 +1679,7 @@ beginfile2: dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ - @mv awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: diff --git a/test/Makefile.in b/test/Makefile.in index 55650e18..e01e273f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2105,7 +2105,7 @@ beginfile2: dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ - @mv awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: diff --git a/test/dumpvars.ok b/test/dumpvars.ok index 5013b351..73d3d306 100644 --- a/test/dumpvars.ok +++ b/test/dumpvars.ok @@ -3,7 +3,6 @@ ARGIND: 0 ARGV: array, 1 elements BINMODE: 0 CONVFMT: "%.6g" -ENVIRON: array, 57 elements ERRNO: "" FIELDWIDTHS: "" FILENAME: "-" @@ -18,7 +17,6 @@ OFMT: "%.6g" OFS: " " ORS: "\n" PREC: 53 -PROCINFO: array, 28 elements RLENGTH: 0 ROUNDMODE: "N" RS: "\n" -- cgit v1.2.3 From 85699a5cba88f4ee910e2c3ef42b5cc165102b51 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 16 Jan 2015 13:55:10 +0200 Subject: Bug fix in pretty-printing comments and test case. --- test/ChangeLog | 5 +++++ test/Makefile.am | 5 +++++ test/Makefile.in | 5 +++++ test/profile8.awk | 9 +++++++++ test/profile8.ok | 14 ++++++++++++++ 5 files changed, 38 insertions(+) create mode 100644 test/profile8.awk create mode 100644 test/profile8.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 500fdb02..75278015 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-01-16 Arnold D. Robbins + + * Makefile.am (profile8): New test. + * profile8.awk, profile8.ok: New files. + 2015-01-14 Arnold D. Robbins * Makefile.am (dumpvars): Grep out ENVIRON and PROCINFO since diff --git a/test/Makefile.am b/test/Makefile.am index c3d8309d..a60547ff 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1727,6 +1727,11 @@ profile7: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile8: + @echo $@ + @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 diff --git a/test/Makefile.in b/test/Makefile.in index 3c036351..73012c81 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2152,6 +2152,11 @@ profile7: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile8: + @echo $@ + @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 diff --git a/test/profile8.awk b/test/profile8.awk new file mode 100644 index 00000000..16252cea --- /dev/null +++ b/test/profile8.awk @@ -0,0 +1,9 @@ +# Some +# header +# comments + +# Add up +{ sum += $1 } + +# Print sum +END { print sum } diff --git a/test/profile8.ok b/test/profile8.ok new file mode 100644 index 00000000..34f7a96b --- /dev/null +++ b/test/profile8.ok @@ -0,0 +1,14 @@ +# Some +# header +# comments + +# Add up +{ + sum += $1 +} + +# Print sum +END { + print sum +} + -- cgit v1.2.3 From f25f9c52b1ab284ac1055b4f8321a2da33e81fcb Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 19 Jan 2015 05:29:09 +0200 Subject: Finish adding profile8 test. --- test/ChangeLog | 5 +++++ test/Makefile.am | 5 ++++- test/Makefile.in | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 75278015..19105027 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-01-19 Arnold D. Robbins + + * Makefile.am (profile8): Actually add the test and the files. + Thanks to Hermann Peifer for the report. + 2015-01-16 Arnold D. Robbins * Makefile.am (profile8): New test. diff --git a/test/Makefile.am b/test/Makefile.am index a60547ff..8f501b56 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -715,6 +715,8 @@ EXTRA_DIST = \ profile6.ok \ profile7.awk \ profile7.ok \ + profile8.awk \ + profile8.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -1034,7 +1036,8 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + 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 \ splitarg4 strftime \ diff --git a/test/Makefile.in b/test/Makefile.in index 73012c81..d4097f3d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -962,6 +962,8 @@ EXTRA_DIST = \ profile6.ok \ profile7.awk \ profile7.ok \ + profile8.awk \ + profile8.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -1280,7 +1282,8 @@ GAWK_EXT_TESTS = \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + 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 \ splitarg4 strftime \ -- cgit v1.2.3