Permalink
Browse files

Make a minor change to the format of the output

  • Loading branch information...
koosha-- committed Dec 3, 2012
1 parent 8faf483 commit 6e02789eaf6abbac88eae7711c890c1178a92e26
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/DDG/Goodie/HexToASCII.pm
  2. +2 −2 t/HexToASCII.t
@@ -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;
};
View
@@ -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;

0 comments on commit 6e02789

Please sign in to comment.