test/re_test.awk
raw| 1 | BEGIN { |
| 2 | x = @/bar/ |
| 3 | y[0] = @/bar/ |
| 4 | y[1] = @/baz/ |
| 5 | y[2] = "bar" |
| 6 | y[3] = "baz" |
| 7 | printf("* set: x = @/%s/\n", x) |
| 8 | for (i in y) { |
| 9 | yfmt = typeof(y[i]) == "regexp" ? sprintf("@/%s/", y[i]) : ""y[i] |
| 10 | printf("* set: y = %s\n", yfmt) |
| 11 | printf("@/%s/ == %s --> %d\n", x, yfmt, x == y[i]) |
| 12 | printf("@/%s/ ~ %s --> %d\n", x, yfmt, x ~ y[i]) |
| 13 | printf("@/%s/ <= %s --> %d\n", x, yfmt, x <= y[i]) |
| 14 | printf("@/%s/ < %s --> %d\n", x, yfmt, x < y[i]) |
| 15 | } |
| 16 | } |