|
#!/usr/bin/perl -w
Labyrinth::Variables::init();
my @tests = (
[ '/path' , 1, 0 ],
[ '/path/here' , 1, 0 ],
[ '/path?query' , 1, 0 ],
[ '/path?query#here' , 1, 0 ],
[ 'example.com' , 1, 0 ],
[ 'example.com/' , 1, 0 ],
[ 'path' , 0, 0 ],
[ 'path?query' , 0, 0 ],
);
for my $test ( @tests ) {
if ( $test ->[1]) {
like( $test ->[0], $settings {urlregex}, ".. urlregex matches '$test->[0]'" );
} else {
unlike( $test ->[0], $settings {urlregex}, ".. urlregex doesn't match '$test->[0]'" );
}
if ( $test ->[2]) {
like( $test ->[0], $settings {urlstrict}, ".. urlstrict matches '$test->[0]'" );
} else {
unlike( $test ->[0], $settings {urlstrict}, ".. urlstrict doesn't match '$test->[0]'" );
}
}
|