aboutsummaryrefslogtreecommitdiffstats
path: root/test/arrdbg.awk
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2016-08-16 10:14:32 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2016-08-16 10:14:32 -0400
commit6602e3d0106728ce6d6919e27de943e8d986fdf8 (patch)
tree7c79ed9f0acb40485c6eb2268e37803dca7f2feb /test/arrdbg.awk
parented6a8b0cbdfd4b2231b89bfa420147a88f7312cf (diff)
downloadegawk-6602e3d0106728ce6d6919e27de943e8d986fdf8.tar.gz
egawk-6602e3d0106728ce6d6919e27de943e8d986fdf8.tar.bz2
egawk-6602e3d0106728ce6d6919e27de943e8d986fdf8.zip
When ARRAYDEBUG is defined, add a test using adump to check the array type.
Diffstat (limited to 'test/arrdbg.awk')
-rw-r--r--test/arrdbg.awk17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/arrdbg.awk b/test/arrdbg.awk
new file mode 100644
index 00000000..951acb41
--- /dev/null
+++ b/test/arrdbg.awk
@@ -0,0 +1,17 @@
+function check(x, exptype, f) {
+ f[x]
+ printf "array_f subscript [%s]\n", x
+ printf "array_f subscript [%s]\n", x > okfile
+ adump(f, -1)
+ printf " array_func: %s_array_func\n", exptype > okfile
+}
+
+BEGIN {
+ check(3.0, "cint")
+ check(-3, "int")
+ check("3.0", "str")
+ split(" 3", f, "|") # create a maybe_num value
+ check(f[1], "str")
+ check("0", "cint")
+ check("-1", "int")
+}