1#!./perl 2 3BEGIN { 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 11use strict; 12use warnings; 13 14use Test::More; # test count at bottom of file 15use re qw(regmust); 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} 30# New tests above this line, don't forget to update the test count below! 31use Test::More tests => 6; 32# No tests here! 33