1# Tests due to John Haque, May 2011 2# 3# The following should be fatal; can't catch them inside awk, though 4# $> echo 'a' | ./gawk '/[z-a]/ { print }' 5# $> echo 'A' | ./gawk '/[+-[:digit:]]/' 6 7BEGIN { 8 char[1] = "." 9 pat[1] = "[--\\/]" 10 11 char[2] = "a" 12 pat[2] = "[]-c]" 13 14 char[3] = "c" 15 pat[3] = "[[a-d]" 16 17 char[4] = "\\" 18 pat[4] = "[\\[-\\]]" 19 20 char[5] = "[.c.]" 21 pat[5] = "[a-[.e.]]" 22 23 char[6] = "[.d.]" 24 pat[6] = "[[.c.]-[.z.]]" 25 26 for (i = 1; i in char; i++) { 27 printf("\"%s\" ~ /%s/ --> %d\n", char[i], pat[i], 28 char[i] ~ pat[i]) 29 } 30} 31