|
Packit |
575503 |
# test the gnu regexp ops
|
|
Packit |
575503 |
|
|
Packit |
575503 |
BEGIN {
|
|
Packit |
575503 |
if ("a rat is here" ~ /\yrat/) print "test 1 ok (\\y)"
|
|
Packit |
575503 |
else print "test 1 failed (\\y)"
|
|
Packit |
575503 |
if ("a rat is here" ~ /rat\y/) print "test 2 ok (\\y)"
|
|
Packit |
575503 |
else print "test 2 failed (\\y)"
|
|
Packit |
575503 |
if ("what a brat" !~ /\yrat/) print "test 3 ok (\\y)"
|
|
Packit |
575503 |
else print "test 3 failed (\\y)"
|
|
Packit |
575503 |
|
|
Packit |
575503 |
if ("in the crate" ~ /\Brat/) print "test 4 ok (\\B)"
|
|
Packit |
575503 |
else print "test 4 failed (\\B)"
|
|
Packit |
575503 |
if ("a rat" !~ /\Brat/) print "test 5 ok (\\B)"
|
|
Packit |
575503 |
else print "test 5 failed (\\B)"
|
|
Packit |
575503 |
|
|
Packit |
575503 |
if ("a word" ~ /\
|
|
Packit |
575503 |
else print "test 6 failed (\\<)"
|
|
Packit |
575503 |
if ("foreword" !~ /\
|
|
Packit |
575503 |
else print "test 7 failed (\\<)"
|
|
Packit |
575503 |
|
|
Packit |
575503 |
if ("a word" ~ /word\>/) print "test 8 ok (\\>)"
|
|
Packit |
575503 |
else print "test 8 failed (\\\\>)"
|
|
Packit |
575503 |
if ("wordy" !~ /word\>/) print "test 9 ok (\\>)"
|
|
Packit |
575503 |
else print "test 9 failed (\\>)"
|
|
Packit |
575503 |
|
|
Packit |
575503 |
if ("a" ~ /\w/) print "test 10 ok (\\w)"
|
|
Packit |
575503 |
else print "test 10 failed (\\\\w)"
|
|
Packit |
575503 |
if ("+" !~ /\w/) print "test 11 ok (\\w)"
|
|
Packit |
575503 |
else print "test 11 failed (\\w)"
|
|
Packit |
575503 |
|
|
Packit |
575503 |
if ("a" !~ /\W/) print "test 12 ok (\\W)"
|
|
Packit |
575503 |
else print "test 12 failed (\\W)"
|
|
Packit |
575503 |
if ("+" ~ /\W/) print "test 13 ok (\\W)"
|
|
Packit |
575503 |
else print "test 13 failed (\\W)"
|
|
Packit |
575503 |
|
|
Packit |
575503 |
if ("a" ~ /\`a/) print "test 14 ok (\\`)"
|
|
Packit |
575503 |
else print "test 14 failed (\\`)"
|
|
Packit |
575503 |
if ("b" !~ /\`a/) print "test 15 ok (\\`)"
|
|
Packit |
575503 |
else print "test 15 failed (\\`)"
|
|
Packit |
575503 |
|
|
Packit |
575503 |
if ("a" ~ /a\'/) print "test 16 ok (\\')"
|
|
Packit |
575503 |
else print "test 16 failed (\\')"
|
|
Packit |
575503 |
if ("b" !~ /a\'/) print "test 17 ok (\\')"
|
|
Packit |
575503 |
else print "test 17 failed (\\')"
|
|
Packit |
575503 |
}
|