Subject: | has_tag_like is broken |
The has_tag_like method doesn't work as advertised. The embedded anonymous subroutine has its regex reversed. The code is:
sub has_tag_like {
my $self = shift;
my $tag = shift;
my $text = shift;
my $desc = shift;
my $found = $self->_tag_walk( $tag, sub { $text =~ $_[0] } );
return $Test->ok( $found, $desc );
}
but should be:
sub has_tag_like {
my $self = shift;
my $tag = shift;
my $regex = shift;
my $desc = shift;
my $found = $self->_tag_walk( $tag, sub { $_[0] =~ $regex } );
return $Test->ok( $found, $desc );
}
(note that I renamed the argument for clarity).
The has_tag.t tests pass by pure luck: qr/Test 3/ eq 'Test 3' when stringified. A better test that would have caught this bug would be qr/Test \s+ 3/x
-- Chris