Permalink
Browse files

remove negatives in unless

  • Loading branch information...
petdance committed Apr 13, 2012
1 parent 65e1335 commit 5bf19e9240f191143b9cf951e104acb27b48cfa6
Showing with 3 additions and 3 deletions.
  1. +3 −3 Mechanize.pm
View
@@ -1120,7 +1120,7 @@ sub _check_links_status {
push( @failures, $url ) unless $mech->status() == $status;
}
else {
- push( @failures, $url ) unless $mech->status() != $status;
+ push( @failures, $url ) if $mech->status() == $status;
}
$mech->back();
}
@@ -1148,10 +1148,10 @@ sub _check_links_content {
if ( $mech->follow_link( url => $url ) ) {
my $content=$mech->content();
if ( $test eq 'like' ) {
- push( @failures, $url ) unless $content=~/$regex/;
+ push( @failures, $url ) unless $content =~ /$regex/;
}
else {
- push( @failures, $url ) unless $content!~/$regex/;
+ push( @failures, $url ) if $content =~ /$regex/;
}
$mech->back();
}

0 comments on commit 5bf19e9

Please sign in to comment.