is( $wanted, $actual, "Pages match" );
but if they don't match, then you have mile-long "expected X, got Y" output. That's no fun.
So do this:
is_deeply( [split
/\n/, $wanted], [split /\n/, $actual], "Pages match" );
Now, it'll show what the first different line is. Much easier to debug, because the output is like this:
not ok 13 - Pages match
# Failed test (t/cached.t at line 54)
# Structures begin differing at:
# $got->[48] = '<td align="center"><b>15:46:02<br>'
# $expected->[48] = '<td align="center"><b>15:45:58<br>'
In fact, I think I may have to submit a is_multiline function to Test::More that is a wrapper around it.
sub is_multiline {
my $got = shift;
my $expected = shift;
my $msg = shift;
return is_deeply( [split/\n/, $got], [split /\n/, $expected], $msg );
}
Schwern, whaddya think?
Sweet! (Score:1)
"Perl users are the Greatful Dead fans of computer science." --slashdot comment
Test::Differences? (Score:1)