Shlomi Fish sent a but report for Test::Differences and I'm afraid that I'm not
comfortable enough with utf8 to be sure of the most appropriate fix (this is
the second report on this topic). Essentially, utf8 characters are output as
their \x{} equivalents and this makes the output unreadable. Suggestions?
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Test::More tests => 1;
use Test::Differences;
# So we can output the text from the tests as UTF-8
binmode(STDOUT, ":encoding(utf-8)");
binmode(STDERR, ":encoding(utf-8)");
# TEST
eq_or_diff(
<<"EOF",
Hello
שלוש
EOF
<<"EOF",
Hello
שלום
EOF
);
__END__ test-diff.t .. 1/1
# Failed test at test-diff.t line 16.
#
+---+----------------------------------+----------------------------------+
# | Ln|Got |Expected
|
#
+---+----------------------------------+----------------------------------+
# | 1|Hello |Hello
|
# * 2|\x{05e9}\x{05dc}\x{05d5}\x{05e9} |\x{05e9}\x{05dc}\x{05d5}\x{05dd} *
#
+---+----------------------------------+----------------------------------+
# Looks like you failed 1 test of 1.
test-diff.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1
subtests
Cheers,
Ovid--
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog - http://use.perl.org/~Ovid/journal/
Twitter - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6