summaryrefslogtreecommitdiff
path: root/test/symtab9.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/symtab9.awk')
-rw-r--r--test/symtab9.awk19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/symtab9.awk b/test/symtab9.awk
new file mode 100644
index 00000000..6b520147
--- /dev/null
+++ b/test/symtab9.awk
@@ -0,0 +1,19 @@
+BEGIN {
+ file = "testit.txt"
+ for (i = 1; i <= 3; i++)
+ print("line", i) > file
+ close(file)
+
+ ARGV[1] = file
+ ARGC = 2
+
+ for (i = 1; i <= 3; i++)
+ getline
+
+ printf "NR should be 3, is %d\n", SYMTAB["NR"]
+
+ # Can't do this here. Windows doesn't let you remove a file that
+ # is still open. Moving it to END won't help either, since the file
+ # (correctly) remain open until after the END finishes.
+ # system("rm testit.txt")
+}