From 8f2b0b9128f4d2dc50ae52c304237c8e9d4b85f9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 26 Jun 2019 21:34:29 +0300 Subject: Fix a problem when using awk::var kinds of names. --- test/ChangeLog | 7 +++++++ test/Makefile.am | 33 +++++++++++++++++++++++++++++++++ test/Makefile.in | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index a53c2d13..99391b0d 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2019-06-26 Arnold D. Robbins + + * Makefile.am (EXTRA_DIST): New tests, nsawk1[abc] and nsawk2[ab]. + * nsawk1.awk, nsawk1a.ok, nsawk1b.ok, nsawk1c.ok, nsawk2.awk, + nsawk2a.ok, nsawk2b.ok: New files. + Tests courtesy of Michal Jaegermann. + 2019-06-19 Arnold D. Robbins * Makefile.am (EXTRA_DIST): New test: escapebrace. diff --git a/test/Makefile.am b/test/Makefile.am index 58ee1304..d7f6e016 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -782,6 +782,13 @@ EXTRA_DIST = \ noparms.ok \ nors.in \ nors.ok \ + nsawk1.awk \ + nsawk1a.ok \ + nsawk1b.ok \ + nsawk1c.ok \ + nsawk2.awk \ + nsawk2a.ok \ + nsawk2b.ok \ nsbad.awk \ nsbad.ok \ nsbad_cmd.ok \ @@ -1353,6 +1360,7 @@ GAWK_EXT_TESTS = \ lint lintexp lintindex lintint lintlength lintold lintset lintwarn \ manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime muldimposix \ nastyparm negtime next nondec nondec2 nonfatal1 nonfatal2 nonfatal3 \ + nsawk1a nsawk1b nsawk1c nsawk2a nsawk2b \ nsbad nsbad_cmd nsforloop nsfuncrecurse nsindirect1 nsindirect2 nsprof1 nsprof2 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge \ procinfs profile0 profile1 profile2 profile3 profile4 profile5 profile6 \ @@ -2042,6 +2050,31 @@ readfile2:: @$(AWK) -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.awk "$(srcdir)"/readdir.awk > _$@ || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nsawk1a:: + @echo $@ + @$(AWK) -f "$(srcdir)"/nsawk1.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nsawk1b:: + @echo $@ + @$(AWK) -v I=fine -f "$(srcdir)"/nsawk1.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nsawk1c:: + @echo $@ + @$(AWK) -v awk::I=fine -f "$(srcdir)"/nsawk1.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nsawk2a:: + @echo $@ + @$(AWK) -v I=fine -f "$(srcdir)"/nsawk2.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nsawk2b:: + @echo $@ + @$(AWK) -v awk::I=fine -f "$(srcdir)"/nsawk2.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + include2:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --include inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Makefile.in b/test/Makefile.in index ce5b2e26..53827516 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1041,6 +1041,13 @@ EXTRA_DIST = \ noparms.ok \ nors.in \ nors.ok \ + nsawk1.awk \ + nsawk1a.ok \ + nsawk1b.ok \ + nsawk1c.ok \ + nsawk2.awk \ + nsawk2a.ok \ + nsawk2b.ok \ nsbad.awk \ nsbad.ok \ nsbad_cmd.ok \ @@ -1612,6 +1619,7 @@ GAWK_EXT_TESTS = \ lint lintexp lintindex lintint lintlength lintold lintset lintwarn \ manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime muldimposix \ nastyparm negtime next nondec nondec2 nonfatal1 nonfatal2 nonfatal3 \ + nsawk1a nsawk1b nsawk1c nsawk2a nsawk2b \ nsbad nsbad_cmd nsforloop nsfuncrecurse nsindirect1 nsindirect2 nsprof1 nsprof2 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge \ procinfs profile0 profile1 profile2 profile3 profile4 profile5 profile6 \ @@ -2491,6 +2499,31 @@ readfile2:: @$(AWK) -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.awk "$(srcdir)"/readdir.awk > _$@ || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nsawk1a:: + @echo $@ + @$(AWK) -f "$(srcdir)"/nsawk1.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nsawk1b:: + @echo $@ + @$(AWK) -v I=fine -f "$(srcdir)"/nsawk1.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nsawk1c:: + @echo $@ + @$(AWK) -v awk::I=fine -f "$(srcdir)"/nsawk1.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nsawk2a:: + @echo $@ + @$(AWK) -v I=fine -f "$(srcdir)"/nsawk2.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nsawk2b:: + @echo $@ + @$(AWK) -v awk::I=fine -f "$(srcdir)"/nsawk2.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + include2:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --include inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ -- cgit v1.2.3 From 076eb06c0c714ca6ee95ca512d114bf9f41038e0 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 26 Jun 2019 21:40:31 +0300 Subject: Add tests for previous fix to namespaces. --- test/nsawk1.awk | 5 +++++ test/nsawk1a.ok | 0 test/nsawk1b.ok | 0 test/nsawk1c.ok | 0 test/nsawk2.awk | 5 +++++ test/nsawk2a.ok | 1 + test/nsawk2b.ok | 1 + 7 files changed, 12 insertions(+) create mode 100644 test/nsawk1.awk create mode 100644 test/nsawk1a.ok create mode 100644 test/nsawk1b.ok create mode 100644 test/nsawk1c.ok create mode 100644 test/nsawk2.awk create mode 100644 test/nsawk2a.ok create mode 100644 test/nsawk2b.ok (limited to 'test') diff --git a/test/nsawk1.awk b/test/nsawk1.awk new file mode 100644 index 00000000..00715bc1 --- /dev/null +++ b/test/nsawk1.awk @@ -0,0 +1,5 @@ +# Used to cause internal error +BEGIN { + x = awk::I + x = awk::I +} diff --git a/test/nsawk1a.ok b/test/nsawk1a.ok new file mode 100644 index 00000000..e69de29b diff --git a/test/nsawk1b.ok b/test/nsawk1b.ok new file mode 100644 index 00000000..e69de29b diff --git a/test/nsawk1c.ok b/test/nsawk1c.ok new file mode 100644 index 00000000..e69de29b diff --git a/test/nsawk2.awk b/test/nsawk2.awk new file mode 100644 index 00000000..d275c121 --- /dev/null +++ b/test/nsawk2.awk @@ -0,0 +1,5 @@ +# Used to cause internal error +BEGIN { + x = awk::I + print x +} diff --git a/test/nsawk2a.ok b/test/nsawk2a.ok new file mode 100644 index 00000000..86815ca7 --- /dev/null +++ b/test/nsawk2a.ok @@ -0,0 +1 @@ +fine diff --git a/test/nsawk2b.ok b/test/nsawk2b.ok new file mode 100644 index 00000000..86815ca7 --- /dev/null +++ b/test/nsawk2b.ok @@ -0,0 +1 @@ +fine -- cgit v1.2.3 From 8ff0d3a5a55237f78a8c3076a07c38f7e1c1c5e9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 26 Jun 2019 21:44:37 +0300 Subject: Add backwards compatibility to inplace extension, update doc and tests. --- test/ChangeLog | 4 ++++ test/inplace1.ok | 2 +- test/inplace2.ok | 2 +- test/inplace3.ok | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 99391b0d..a538c593 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -5,6 +5,10 @@ nsawk2a.ok, nsawk2b.ok: New files. Tests courtesy of Michal Jaegermann. + Unrelated: + + * inplace1.ok, inplace2.ok, inplace3.ok: Updated after code changes. + 2019-06-19 Arnold D. Robbins * Makefile.am (EXTRA_DIST): New test: escapebrace. diff --git a/test/inplace1.ok b/test/inplace1.ok index 753079b3..f2e36d46 100644 --- a/test/inplace1.ok +++ b/test/inplace1.ok @@ -1,5 +1,5 @@ before -gawk: inplace:53: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:59: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' stdin start is bar replaced? stdin end diff --git a/test/inplace2.ok b/test/inplace2.ok index 753079b3..f2e36d46 100644 --- a/test/inplace2.ok +++ b/test/inplace2.ok @@ -1,5 +1,5 @@ before -gawk: inplace:53: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:59: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' stdin start is bar replaced? stdin end diff --git a/test/inplace3.ok b/test/inplace3.ok index 7802a0c8..b6f26505 100644 --- a/test/inplace3.ok +++ b/test/inplace3.ok @@ -1,11 +1,11 @@ before -gawk: inplace:53: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:59: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' stdin start is bar replaced? stdin end after Before -gawk: inplace:53: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:59: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' stdin start is foo replaced? stdin end -- cgit v1.2.3