diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-01-16 13:55:10 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-01-16 13:55:10 +0200 |
commit | 85699a5cba88f4ee910e2c3ef42b5cc165102b51 (patch) | |
tree | 0c30408d16fae795c48a59d2869d57c4b45ab5fd /test | |
parent | 28f563a6f54c8ea9c63537356966508c4685b538 (diff) | |
download | egawk-85699a5cba88f4ee910e2c3ef42b5cc165102b51.tar.gz egawk-85699a5cba88f4ee910e2c3ef42b5cc165102b51.tar.bz2 egawk-85699a5cba88f4ee910e2c3ef42b5cc165102b51.zip |
Bug fix in pretty-printing comments and test case.
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 5 | ||||
-rw-r--r-- | test/Makefile.in | 5 | ||||
-rw-r--r-- | test/profile8.awk | 9 | ||||
-rw-r--r-- | test/profile8.ok | 14 |
5 files changed, 38 insertions, 0 deletions
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 <arnold@skeeve.com> + + * Makefile.am (profile8): New test. + * profile8.awk, profile8.ok: New files. + 2015-01-14 Arnold D. Robbins <arnold@skeeve.com> * 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 +} + |