File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use strict;
22use warnings qw/ FATAL/ ;
33use utf8;
44
5- use Test::Simple tests => 8 ;
5+ use Test::Simple tests => 9 ;
66use Regex::Object;
77
88$| =1;
@@ -118,6 +118,10 @@ ok($result eq $expected,
118118# # TEST 8
119119# Test global matching with scoped regex with modifiers: captures_all
120120
121+ $re = Regex::Object-> new(
122+ regex => qr / ([A-Z]+?) ([A-Z]+)/ i ,
123+ );
124+
121125$expected = ' John Doe Eric Lide Hans Zimmermann' ;
122126$result = join " \040 " , map { join " \040 " , @$_ } @{ $re -> match_all($expected )-> captures_all };
123127
@@ -127,3 +131,15 @@ ok($result eq $expected,
127131 $expected ,
128132 )
129133);
134+
135+ # # TEST 9
136+ # Test unsuccessful matching
137+
138+ $re = Regex::Object-> new(regex => qr /\d +/ );
139+ $result = $re -> match(' foo' )-> success;
140+
141+ ok(!$result ,
142+ sprintf (' Returns wrong value: %s, expected: undef' ,
143+ $result ,
144+ )
145+ );
You can’t perform that action at this time.
0 commit comments