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