libwww-perl / URI

The Perl URI module
https://metacpan.org/pod/URI
Other
41 stars 48 forks source link

Replace raw TAP printing with "Test::More" #108

Closed JRaspass closed 2 years ago

JRaspass commented 2 years ago

Like #107 I believe this gives a much nicer UX for future developers and maintainers of this codebase, also the line savings definitely don't hurt!

To aid review, since this is a big change, I've tried to be very minimal in what I change, I don't add test names and most assertions are just the same but wrapped in an ok unless it was trivial to use is or like.

I think this port even found a bug! In t/ldap.t we do:

 $uri->filter("f=?,#");
-print "not " unless $uri->query eq "??f=%3F,%23" &&
-                    $uri->filter eq "f=?,#";
+ok($uri->query eq "??f=%3F,%23" &&
+   $uri->filter eq "f=?,#");

 $uri->filter("(int=\\00\\00\\00\\04)");
-print "not " unless $uri->query eq "??(int=%5C00%5C00%5C00%5C04)";
-print "ok 12\n";
+is($uri->query, "??(int=%5C00%5C00%5C00%5C04)");

-print "ok 13\n";
 $uri->filter("");

Those prints were in the wrong order as both nots appeared before both oks.

oalders commented 2 years ago

Thanks, @JRaspass!