Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

switched util.t to use Test::More

  • Loading branch information...
commit 4d5d568513a2ab4402e25f513b0763bbf394746e 1 parent 327c305
authored September 03, 2009

Showing 1 changed file with 6 additions and 17 deletions. Show diff stats Hide diff stats

  1. 23  t/util.t
23  t/util.t
@@ -2,23 +2,12 @@
2 2
 
3 3
 # Test ability to escape() and unescape() punctuation characters
4 4
 # except for qw(- . _).
5  
-######################### We start with some black magic to print on failure.
6 5
 
7  
-BEGIN {$| = 1; print "1..57\n"; }
8  
-END {print "not ok 1\n" unless $loaded;}
9  
-use Config;
10  
-use CGI::Util qw(escape unescape);
11  
-$loaded = 1;
12  
-print "ok 1\n";
13  
-
14  
-######################### End of black magic.
  6
+$| = 1;
15 7
 
16  
-# util
17  
-sub test {
18  
-    local($^W) = 0;
19  
-    my($num, $true,$msg) = @_;
20  
-    print($true ? "ok $num\n" : "not ok $num $msg\n");
21  
-}
  8
+use Test::More tests => 57;
  9
+use Config;
  10
+use_ok ( 'CGI::Util', qw(escape unescape) );
22 11
 
23 12
 # ASCII order, ASCII codepoints, ASCII repertoire
24 13
 
@@ -41,10 +30,10 @@ foreach(sort(keys(%punct))) {
41 30
     $i++;
42 31
     my $escape = "AbC\%$punct{$_}dEF";
43 32
     my $cgi_escape = escape("AbC$_" . "dEF");
44  
-    test($i, $escape eq $cgi_escape , "# $escape ne $cgi_escape");
  33
+    is($escape, $cgi_escape , "# $escape ne $cgi_escape");
45 34
     $i++;
46 35
     my $unescape = "AbC$_" . "dEF";
47 36
     my $cgi_unescape = unescape("AbC\%$punct{$_}dEF");
48  
-    test($i, $unescape eq $cgi_unescape , "# $unescape ne $cgi_unescape");
  37
+    is($unescape, $cgi_unescape , "# $unescape ne $cgi_unescape");
49 38
 }
50 39
 

0 notes on commit 4d5d568

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