From 4fdd2362ad9c9a215da4b4a9f2c96b15a5d5d881 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 8 Jun 2020 22:18:07 +0300 Subject: Fix ` print $"2" ' case. --- test/ChangeLog | 5 +++++ test/Makefile.am | 6 +++++- test/Makefile.in | 11 ++++++++++- test/Maketests | 5 +++++ test/strfieldnum.awk | 1 + test/strfieldnum.in | 1 + test/strfieldnum.ok | 1 + 7 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 test/strfieldnum.awk create mode 100644 test/strfieldnum.in create mode 100644 test/strfieldnum.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 097f19bd..cca09eb6 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2020-06-08 Arnold D. Robbins + + * Makefile.am (EXTRA_DIST): New test, strfieldnum. + * strfieldnum.awk, strfieldnum.in, strfieldnum.ok: New files. + 2020-05-06 Arnold D. Robbins * Makefile.am (EXTRA_DIST): New test, lintplus. diff --git a/test/Makefile.am b/test/Makefile.am index 55b1ff34..3c241aae 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1165,6 +1165,9 @@ EXTRA_DIST = \ status-close.ok \ strcat1.awk \ strcat1.ok \ + strfieldnum.awk \ + strfieldnum.in \ + strfieldnum.ok \ strftime.awk \ strftlng.awk \ strftlng.ok \ @@ -1371,7 +1374,8 @@ BASIC_TESTS = \ rstest1 rstest2 rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin setrec0 setrec1 \ sigpipe1 sortempty sortglos spacere splitargv splitarr \ - splitdef splitvar splitwht status-close strcat1 strnum1 strnum2 strtod \ + splitdef splitvar splitwht status-close \ + strcat1 strfieldnum strnum1 strnum2 strtod \ subamp subback subi18n subsepnm subslash substr swaplns synerr1 synerr2 synerr3 \ tailrecurse tradanch trailbs tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs uplus \ diff --git a/test/Makefile.in b/test/Makefile.in index dd1f8316..b774c549 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1428,6 +1428,9 @@ EXTRA_DIST = \ status-close.ok \ strcat1.awk \ strcat1.ok \ + strfieldnum.awk \ + strfieldnum.in \ + strfieldnum.ok \ strftime.awk \ strftlng.awk \ strftlng.ok \ @@ -1634,7 +1637,8 @@ BASIC_TESTS = \ rstest1 rstest2 rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin setrec0 setrec1 \ sigpipe1 sortempty sortglos spacere splitargv splitarr \ - splitdef splitvar splitwht status-close strcat1 strnum1 strnum2 strtod \ + splitdef splitvar splitwht status-close \ + strcat1 strfieldnum strnum1 strnum2 strtod \ subamp subback subi18n subsepnm subslash substr swaplns synerr1 synerr2 synerr3 \ tailrecurse tradanch trailbs tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs uplus \ @@ -3932,6 +3936,11 @@ strcat1: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +strfieldnum: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + strnum1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 4bee1ddc..a59771a8 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1062,6 +1062,11 @@ strcat1: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +strfieldnum: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + strnum1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/strfieldnum.awk b/test/strfieldnum.awk new file mode 100644 index 00000000..053033c6 --- /dev/null +++ b/test/strfieldnum.awk @@ -0,0 +1 @@ +{ print $"2" } diff --git a/test/strfieldnum.in b/test/strfieldnum.in new file mode 100644 index 00000000..3774da60 --- /dev/null +++ b/test/strfieldnum.in @@ -0,0 +1 @@ +a b c diff --git a/test/strfieldnum.ok b/test/strfieldnum.ok new file mode 100644 index 00000000..61780798 --- /dev/null +++ b/test/strfieldnum.ok @@ -0,0 +1 @@ +b -- cgit v1.2.3