Commit | Line | Data |
de8c5301 |
1 | #!./perl |
2 | |
3 | BEGIN { |
de8c5301 |
4 | require Config; |
5 | if (($Config::Config{'extensions'} !~ /\bre\b/) ){ |
6 | print "1..0 # Skip -- Perl configured without re module\n"; |
7 | exit 0; |
8 | } |
9 | } |
10 | |
11 | use strict; |
08f18727 |
12 | use warnings; |
de8c5301 |
13 | |
256ddcd0 |
14 | use Test::More; # test count at bottom of file |
192c1e27 |
15 | use re qw(regmust); |
256ddcd0 |
16 | { |
17 | my $qr=qr/here .* there/x; |
18 | my ($anchored,$floating)=regmust($qr); |
19 | is($anchored,'here',"Regmust anchored - qr//"); |
20 | is($floating,'there',"Regmust floating - qr//"); |
21 | my $foo='blah'; |
22 | ($anchored,$floating)=regmust($foo); |
23 | is($anchored,undef,"Regmust anchored - non ref"); |
24 | is($floating,undef,"Regmust anchored - non ref"); |
25 | my $bar=['blah']; |
26 | ($anchored,$floating)=regmust($foo); |
27 | is($anchored,undef,"Regmust anchored - ref"); |
28 | is($floating,undef,"Regmust anchored - ref"); |
29 | } |
256ddcd0 |
30 | # New tests above this line, don't forget to update the test count below! |
192c1e27 |
31 | use Test::More tests => 6; |
256ddcd0 |
32 | # No tests here! |