aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am4
-rw-r--r--test/Makefile.in9
-rw-r--r--test/Maketests5
-rw-r--r--test/typeof2.awk20
-rw-r--r--test/typeof2.ok6
6 files changed, 47 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index b57a756f..393f38e8 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (typeof2): New test.
+ * typeof2.awk, typeof2.ok: New files.
+
2015-06-19 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (gsubind, typedregex1, typeof1): New tests.
diff --git a/test/Makefile.am b/test/Makefile.am
index 537a5655..25b8b708 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -985,6 +985,8 @@ EXTRA_DIST = \
typedregex1.ok \
typeof1.awk \
typeof1.ok \
+ typeof2.awk \
+ typeof2.ok \
uninit2.awk \
uninit2.ok \
uninit3.awk \
@@ -1099,7 +1101,7 @@ GAWK_EXT_TESTS = \
splitarg4 strftime \
strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \
symtab7 symtab8 symtab9 \
- typedregex1 typeof1
+ typedregex1 typeof1 typeof2
timeout
EXTRA_TESTS = inftest regtest
diff --git a/test/Makefile.in b/test/Makefile.in
index a8895ed7..1ab60181 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1242,6 +1242,8 @@ EXTRA_DIST = \
typedregex1.ok \
typeof1.awk \
typeof1.ok \
+ typeof2.awk \
+ typeof2.ok \
uninit2.awk \
uninit2.ok \
uninit3.awk \
@@ -1355,7 +1357,7 @@ GAWK_EXT_TESTS = \
splitarg4 strftime \
strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \
symtab7 symtab8 symtab9 \
- typedregex1 typeof1
+ typedregex1 typeof1 typeof2
EXTRA_TESTS = inftest regtest
INET_TESTS = inetdayu inetdayt inetechu inetecht
@@ -3905,6 +3907,11 @@ typeof1:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+typeof2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
double1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index a674d5d0..baf973ec 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1342,6 +1342,11 @@ typeof1:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+typeof2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
double1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/typeof2.awk b/test/typeof2.awk
new file mode 100644
index 00000000..25da02e4
--- /dev/null
+++ b/test/typeof2.awk
@@ -0,0 +1,20 @@
+BEGIN {
+ print typeof(x)
+ x[1] = 3
+ print typeof(x)
+}
+
+function test1() {
+}
+
+function test2(p) {
+ p[1] = 1
+}
+
+BEGIN {
+ print typeof(a)
+ test1(a)
+ print typeof(a)
+ test2(a)
+ print typeof(a)
+}
diff --git a/test/typeof2.ok b/test/typeof2.ok
new file mode 100644
index 00000000..cc032a83
--- /dev/null
+++ b/test/typeof2.ok
@@ -0,0 +1,6 @@
+untyped
+array
+untyped
+gawk: typeof2.awk:16: warning: function `test1' called with more arguments than declared
+untyped
+array