Make a minor change to the format of the output
parent
8faf48358c
commit
6e02789eaf
|
@ -35,12 +35,12 @@ handle remainder => sub {
|
|||
return if $hex <= 0x1F || $hex >= 0x7F;
|
||||
$string .= chr $hex;
|
||||
}
|
||||
$string =~ s/\n/ /g;
|
||||
# Don't let long strings make the output untidy
|
||||
if (length($string) > MAX_OUTPUT_LEN) {
|
||||
$string = substr($string, 0, MAX_OUTPUT_LEN - 3) . '...';
|
||||
}
|
||||
return "ASCII: $string";
|
||||
$string =~ s/\n/ /g;
|
||||
return "$string (ASCII)";
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
|
|
@ -12,8 +12,8 @@ ddg_goodie_test(
|
|||
[qw(
|
||||
DDG::Goodie::HexToASCII
|
||||
)],
|
||||
'ascii 0x74657374' => test_zci('ASCII: test'),
|
||||
'ascii 0x5468697320697320612074657374' => test_zci('ASCII: This is a test'),
|
||||
'ascii 0x74657374' => test_zci('test (ASCII)'),
|
||||
'ascii 0x5468697320697320612074657374' => test_zci('This is a test (ASCII)'),
|
||||
);
|
||||
|
||||
done_testing;
|
||||
|
|
Loading…
Reference in New Issue