summaryrefslogtreecommitdiff
path: root/test/symtab9.awk
blob: 6b5201476167d3c2a847bb00ca40421cbdc28e6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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")
}