use File::Spec;
use Test::More;
+eval {
+ require Test::LongString;
+ Test::LongString->import(max => 128);
+
+ no warnings 'redefine'; # override module to not escape newlines
+ my $formatter = *Test::LongString::_display;
+ my $parent = \&{$formatter};
+ *{$formatter} = sub {
+ my $s = &{$parent};
+ $s =~ s/\Q\x{0a}/\n /g; # revert newline quoting
+ return $s;
+ };
+} or *is_string = \&is; # fallback to ugly unformatted is()
+
eval { require PerlIO::scalar };
plan skip_all => "PerlIO required (perl 5.8) to test PLP" if $@;
return;
}
$output =~ s{((?:.+\n)*)}{ join "", sort split /(?<=\n)/, $1 }e; # order headers
- is($output, $expect, $test);
+ is_string($output, $expect, $test);
}
sub getwarning {