From a3ad4921f31020b0f2bedc936fcd050ef5c2e698 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 24 Nov 2018 19:35:51 +0200 Subject: Improve portability of spacere test. --- test/ChangeLog | 6 ++++++ test/Makefile.am | 5 +++++ test/Makefile.in | 10 +++++----- test/Maketests | 5 ----- test/spacere.awk | 2 +- 5 files changed, 17 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index a331619e..522934a4 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2018-11-24 Arnold D. Robbins + + * spacere.awk: Move setting of LC_ALL=C out to ... + * Makefile.am (spacere): ... here. Added test. + Per request from Eli Zaretskii to help porting to MinGW. + 2018-10-10 Arnold D. Robbins * Makefile.am (profile1): Add minus to ignore errors on final diff --git a/test/Makefile.am b/test/Makefile.am index 171a7620..5ca312c2 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -2215,6 +2215,11 @@ longwrds: @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +spacere: + @echo $@ + @LC_ALL=C AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index 74e8b3d2..8a66e7b8 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2658,6 +2658,11 @@ longwrds: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -v SORT="$(SORT)" < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +spacere: + @echo $@ + @LC_ALL=C AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: @@ -3661,11 +3666,6 @@ sortglos: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -spacere: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - splitargv: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index fd6a2713..65f0197c 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1001,11 +1001,6 @@ sortglos: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -spacere: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - splitargv: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/spacere.awk b/test/spacere.awk index 6aa87d2e..ba959309 100644 --- a/test/spacere.awk +++ b/test/spacere.awk @@ -8,7 +8,7 @@ BEGIN { c["\t"] = "\\t" c["\v"] = "\\v" - sort = "LC_ALL=C sort" + sort = "sort" for (i in c) printf("%s %s [[:space:]]\n", c[i], -- cgit v1.2.3 From 2e1281063c92115a8da96906aab6e2be0e9dd78d Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 24 Nov 2018 19:45:09 +0200 Subject: Add test for command line typed regexp assignment. --- test/ChangeLog | 5 +++++ test/Makefile.am | 10 +++++++++- test/Makefile.in | 8 +++++++- test/typedregex4.awk | 7 +++++++ test/typedregex4.ok | 2 ++ 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 test/typedregex4.awk create mode 100644 test/typedregex4.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 522934a4..36599fdd 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -4,6 +4,11 @@ * Makefile.am (spacere): ... here. Added test. Per request from Eli Zaretskii to help porting to MinGW. + Unrelated: + + * Makefile.am (EXTRA_DIST): New test: typedregex4. + * typedregex4.awk, typedregex4.ok: New files. + 2018-10-10 Arnold D. Robbins * Makefile.am (profile1): Add minus to ignore errors on final diff --git a/test/Makefile.am b/test/Makefile.am index 5ca312c2..aa7e6fce 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1176,6 +1176,8 @@ EXTRA_DIST = \ typedregex2.ok \ typedregex3.awk \ typedregex3.ok \ + typedregex4.awk \ + typedregex4.ok \ typeof1.awk \ typeof1.ok \ typeof2.awk \ @@ -1311,7 +1313,8 @@ GAWK_EXT_TESTS = \ shadow shadowbuiltin sortfor sortfor2 sortu sourcesplit split_after_fpat \ splitarg4 strftime strftfld strtonum strtonum1 switch2 symtab1 symtab2 \ symtab3 symtab4 symtab5 symtab6 symtab7 symtab8 symtab9 symtab10 \ - typedregex1 typedregex2 typedregex3 typeof1 typeof2 typeof3 typeof4 \ + typedregex1 typedregex2 typedregex3 typedregex4 \ + typeof1 typeof2 typeof3 typeof4 \ typeof5 timeout \ watchpoint1 @@ -2220,6 +2223,11 @@ spacere: @LC_ALL=C AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +typedregex4: + @echo $@ + @$(AWK) -v x=@/foo/ -f "$(srcdir)"/$@.awk y=@/bar/ /dev/null >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index 8a66e7b8..ccab8144 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1569,7 +1569,8 @@ GAWK_EXT_TESTS = \ shadow shadowbuiltin sortfor sortfor2 sortu sourcesplit split_after_fpat \ splitarg4 strftime strftfld strtonum strtonum1 switch2 symtab1 symtab2 \ symtab3 symtab4 symtab5 symtab6 symtab7 symtab8 symtab9 symtab10 \ - typedregex1 typedregex2 typedregex3 typeof1 typeof2 typeof3 typeof4 \ + typedregex1 typedregex2 typedregex3 typedregex4 \ + typeof1 typeof2 typeof3 typeof4 \ typeof5 timeout \ watchpoint1 @@ -2663,6 +2664,11 @@ spacere: @echo $@ @LC_ALL=C AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +typedregex4: + @echo $@ + @$(AWK) -v x=@/foo/ -f "$(srcdir)"/$@.awk y=@/bar/ /dev/null >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: diff --git a/test/typedregex4.awk b/test/typedregex4.awk new file mode 100644 index 00000000..8e866c34 --- /dev/null +++ b/test/typedregex4.awk @@ -0,0 +1,7 @@ +BEGIN { + print "typeof(x) =", typeof(x) +} + +END { + print "typeof(y) =", typeof(y) +} diff --git a/test/typedregex4.ok b/test/typedregex4.ok new file mode 100644 index 00000000..6656b61f --- /dev/null +++ b/test/typedregex4.ok @@ -0,0 +1,2 @@ +typeof(x) = regexp +typeof(y) = regexp -- cgit v1.2.3