Skip to content

Commit 0d3c706

Browse files
committed
[i] fix typo with colection spelled with one 'l' in Matches.pm
Took 5 minutes Took 5 minutes
1 parent 232a897 commit 0d3c706

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.21 2022-01-12 08:49:06-07:00 Europe/Moscow
2+
- Regex::Object::Matches->captures_all typo in method body with collection spelled with one 'l'
3+
14
1.20 2022-01-12 18:49:03-05:00 Europe/Moscow
25
- Regex::Object::Matches collection
36
- Regex::Object->match_all method to abstract from while when global searching

dist.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ license = Perl_5
55
copyright_holder = Alexander Panteleev
66
copyright_year = 2022
77

8-
version = 1.20
8+
version = 1.21
99

1010
[AutoPrereqs]
1111

lib/Regex/Object.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use Regex::Object::Matches;
1111
use Moo;
1212
use namespace::clean;
1313

14-
our $VERSION = '1.20';
14+
our $VERSION = '1.21';
1515

1616
tie my %nc, "Tie::Hash::NamedCapture";
1717
tie my %nca, "Tie::Hash::NamedCapture", all => 1;
@@ -84,7 +84,7 @@ Regex::Object - solves problems with global Regex variables side effects.
8484
8585
=head1 VERSION
8686
87-
version 1.20
87+
version 1.21
8888
8989
=head1 SYNOPSIS
9090

lib/Regex/Object/Matches.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ sub match_all {
2222
sub captures_all {
2323
my $self = shift;
2424

25-
return [map { $_->captures } @{$self->colection}];
25+
return [map { $_->captures } @{$self->collection}];
2626
}
2727

2828
1;

t/02_matches.t

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use strict;
22
use warnings qw/FATAL/;
33
use utf8;
44

5-
use Test::Simple tests => 7;
5+
use Test::Simple tests => 8;
66
use Regex::Object;
77

88
$|=1;
@@ -99,7 +99,7 @@ ok($result eq $expected,
9999
);
100100

101101
## TEST 7
102-
# Test global matching with scoped regex with modifiers
102+
# Test global matching with scoped regex with modifiers: match_all method
103103

104104
$re = Regex::Object->new(
105105
regex => qr/([A-Z]+?) ([A-Z]+)/i,
@@ -114,3 +114,16 @@ ok($result eq $expected,
114114
$expected,
115115
)
116116
);
117+
118+
## TEST 8
119+
# Test global matching with scoped regex with modifiers: captures_all
120+
121+
$expected = 'John Doe Eric Lide Hans Zimmermann';
122+
$result = join "\040", map { join "\040", @$_ } @{ $re->match_all($expected)->captures_all };
123+
124+
ok($result eq $expected,
125+
sprintf('Returns wrong value: %s, expected: %s',
126+
$result,
127+
$expected,
128+
)
129+
);

0 commit comments

Comments
 (0)