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
CommitLineData
de8c5301 1#!./perl
2
3BEGIN {
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
11use strict;
08f18727 12use warnings;
de8c5301 13
256ddcd0 14use Test::More; # test count at bottom of file
192c1e27 15use 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 31use Test::More tests => 6;
256ddcd0 32# No tests here!