aboutsummaryrefslogtreecommitdiffstats
path: root/test/arraytype.awk
blob: 70fd72b01d75ba6617f842dd2bd4bf67da6a5a05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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"]
}