Skip to content
This repository
Browse code

Make a minor change to the format of the output

  • Loading branch information...
commit 6e02789eaf6abbac88eae7711c890c1178a92e26 1 parent 8faf483
Koosha K. M. authored December 03, 2012
4  lib/DDG/Goodie/HexToASCII.pm
@@ -35,12 +35,12 @@ handle remainder => sub {
35 35
            return if $hex <= 0x1F || $hex >= 0x7F;
36 36
            $string .= chr $hex;
37 37
        }
38  
-       $string =~ s/\n/ /g;
39 38
        # Don't let long strings make the output untidy
40 39
        if (length($string) > MAX_OUTPUT_LEN) {
41 40
            $string = substr($string, 0, MAX_OUTPUT_LEN - 3) . '...';
42 41
        }
43  
-       return "ASCII: $string";
  42
+       $string =~ s/\n/ /g;
  43
+       return "$string (ASCII)";
44 44
     }
45 45
     return;
46 46
 };
4  t/HexToASCII.t
@@ -12,8 +12,8 @@ ddg_goodie_test(
12 12
         [qw(
13 13
                 DDG::Goodie::HexToASCII
14 14
         )],
15  
-        'ascii 0x74657374' => test_zci('ASCII: test'),
16  
-        'ascii 0x5468697320697320612074657374' => test_zci('ASCII: This is a test'),
  15
+        'ascii 0x74657374' => test_zci('test (ASCII)'),
  16
+        'ascii 0x5468697320697320612074657374' => test_zci('This is a test (ASCII)'),
17 17
 );
18 18
 
19 19
 done_testing;

0 notes on commit 6e02789

Please sign in to comment.
Something went wrong with that request. Please try again.