aboutsummaryrefslogtreecommitdiffstats
path: root/test/arraytype.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/arraytype.awk')
-rw-r--r--test/arraytype.awk35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/arraytype.awk b/test/arraytype.awk
new file mode 100644
index 00000000..70fd72b0
--- /dev/null
+++ b/test/arraytype.awk
@@ -0,0 +1,35 @@
+BEGIN {
+ # N.B. This relies upon the undocumented 2nd argument to typeof
+ x[0] = 0
+ print typeof(x, a)
+ print a["array_type"]
+
+ # make sure it resets
+ delete x[0]
+ print typeof(x, a)
+ print a["array_type"]
+
+ x["fubar"] = 0
+ print typeof(x, a)
+ print a["array_type"]
+
+ delete x["fubar"]
+ print typeof(x, a)
+ print a["array_type"]
+
+ x[-2] = 0
+ print typeof(x, a)
+ print a["array_type"]
+
+ delete x[-2]
+ print typeof(x, a)
+ print a["array_type"]
+
+ x[2] = 0
+ print typeof(x, a)
+ print a["array_type"]
+
+ delete x
+ print typeof(x, a)
+ print a["array_type"]
+}