test/arraytype.awk
raw| 1 | BEGIN { |
| 2 | # N.B. This relies upon the undocumented 2nd argument to typeof |
| 3 | x[0] = 0 |
| 4 | print typeof(x, a) |
| 5 | print a["array_type"] |
| 6 | |
| 7 | # make sure it resets |
| 8 | delete x[0] |
| 9 | print typeof(x, a) |
| 10 | print a["array_type"] |
| 11 | |
| 12 | x["fubar"] = 0 |
| 13 | print typeof(x, a) |
| 14 | print a["array_type"] |
| 15 | |
| 16 | delete x["fubar"] |
| 17 | print typeof(x, a) |
| 18 | print a["array_type"] |
| 19 | |
| 20 | x[-2] = 0 |
| 21 | print typeof(x, a) |
| 22 | print a["array_type"] |
| 23 | |
| 24 | delete x[-2] |
| 25 | print typeof(x, a) |
| 26 | print a["array_type"] |
| 27 | |
| 28 | x[2] = 0 |
| 29 | print typeof(x, a) |
| 30 | print a["array_type"] |
| 31 | |
| 32 | delete x |
| 33 | print typeof(x, a) |
| 34 | print a["array_type"] |
| 35 | } |