aboutsummaryrefslogtreecommitdiffstats
path: root/test/nsforloop.awk
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2019-01-25 11:47:18 +0200
committerArnold D. Robbins <arnold@skeeve.com>2019-01-25 11:47:18 +0200
commiteceb548b02f0d72ca6a6e9a68bfd615ac9549a64 (patch)
tree10d127076e7f850560095dd386c9f28b2c4811aa /test/nsforloop.awk
parent378de9aa9e73d44d0172947c38be67c0bd78a0b0 (diff)
downloadegawk-eceb548b02f0d72ca6a6e9a68bfd615ac9549a64.tar.gz
egawk-eceb548b02f0d72ca6a6e9a68bfd615ac9549a64.tar.bz2
egawk-eceb548b02f0d72ca6a6e9a68bfd615ac9549a64.zip
Rework namespace handling to make simpler and correct. Add two test cases.
Diffstat (limited to 'test/nsforloop.awk')
-rw-r--r--test/nsforloop.awk20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/nsforloop.awk b/test/nsforloop.awk
new file mode 100644
index 00000000..b050db64
--- /dev/null
+++ b/test/nsforloop.awk
@@ -0,0 +1,20 @@
+@namespace "foo"
+
+function test(v)
+{
+ print "-- 1"
+ for (i in Data)
+ print i
+
+ print "-- 2"
+ for (v in Data)
+ print v
+ print "-- 3"
+}
+
+BEGIN {
+ Data[1] = 1
+ Data[2] = 2
+
+ test()
+}