Upgrade to Attribute::Handlers 0.87 (which is just a core sync) -- for real
[p5sagit/p5-mst-13.2.git] / ext / re / t / re_funcs.t
1 #!./perl
2
3 BEGIN {
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;
12 use warnings;
13
14 use Test::More; # test count at bottom of file
15 use 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!
31 use Test::More tests => 6;
32 # No tests here!