Show
Ignore:
Timestamp:
01/18/08 03:07:22 (6 years ago)
Author:
miyagawa
Message:

added wrapper _h to get better Test::More fail log

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Encode-JP-Mobile/trunk/t/emoji_convert_utf8.t

    r4827 r4830  
    1111simple_pair(docomo => "\xee\x98\xbe", kddi => "\xee\xbd\xa6", softbank => "\xee\x81\x8a"); # KDDI-Auto 
    1212 
     13sub _h { 
     14    # for better Test::More log 
     15    my $bytes = shift; 
     16    my $out = unpack "H*", $bytes; 
     17    $out =~ s/(..)/\\x$1/g; 
     18    $out; 
     19} 
     20 
    1321sub simple_pair { 
    1422    my(%bytes) = @_; 
     
    2028            my $char = decode("x-utf8-" . $from, $bytes{$from}); 
    2129            my $hex  = sprintf '%X', ord $char; 
    22             is encode("x-utf8-" . $to, $char), $bytes{$to}, "$from -> $to (U+$hex)"; 
     30            is _h(encode("x-utf8-" . $to, $char)), _h($bytes{$to}), "$from -> $to (U+$hex)"; 
    2331        } 
    2432    }