diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-11-24 19:45:09 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-11-24 19:45:09 +0200 |
commit | 2e1281063c92115a8da96906aab6e2be0e9dd78d (patch) | |
tree | 8e24b1e087ad40254a8e629148ae793ba93d2f90 | |
parent | a3ad4921f31020b0f2bedc936fcd050ef5c2e698 (diff) | |
download | egawk-2e1281063c92115a8da96906aab6e2be0e9dd78d.tar.gz egawk-2e1281063c92115a8da96906aab6e2be0e9dd78d.tar.bz2 egawk-2e1281063c92115a8da96906aab6e2be0e9dd78d.zip |
Add test for command line typed regexp assignment.
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 10 | ||||
-rw-r--r-- | test/Makefile.in | 8 | ||||
-rw-r--r-- | test/typedregex4.awk | 7 | ||||
-rw-r--r-- | test/typedregex4.ok | 2 |
5 files changed, 30 insertions, 2 deletions
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 <arnold@skeeve.com> * 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 |