summaryrefslogtreecommitdiff
path: root/t/news.t
diff options
context:
space:
mode:
authorJames Raspass <jraspass@gmail.com>2022-08-21 20:48:21 +0100
committerOlaf Alders <olaf@wundersolutions.com>2022-08-22 08:26:51 -0400
commitd58d34967abc31ad7d22a71aa5e15d407d77799a (patch)
tree68fb1ea013aa4f496a9267260e38b533146572c6 /t/news.t
parent9cc1f62cb927c7a022f3f3b0d30c6e3f9a06a924 (diff)
downloaduri-d58d34967abc31ad7d22a71aa5e15d407d77799a.tar.gz
Replace raw TAP printing with "Test::More"
Diffstat (limited to 't/news.t')
-rw-r--r--t/news.t51
1 files changed, 21 insertions, 30 deletions
diff --git a/t/news.t b/t/news.t
index e1c9b2a..ccdc122 100644
--- a/t/news.t
+++ b/t/news.t
@@ -1,57 +1,48 @@
use strict;
use warnings;
-print "1..8\n";
+use Test::More tests => 8;
use URI ();
my $u = URI->new("news:comp.lang.perl.misc");
-print "not " unless $u->group eq "comp.lang.perl.misc" &&
- !defined($u->message) &&
- $u->port == 119 &&
- $u eq "news:comp.lang.perl.misc";
-print "ok 1\n";
+ok($u->group eq "comp.lang.perl.misc" &&
+ !defined($u->message) &&
+ $u->port == 119 &&
+ $u eq "news:comp.lang.perl.misc");
$u->host("news.online.no");
-print "not " unless $u->group eq "comp.lang.perl.misc" &&
- $u->port == 119 &&
- $u eq "news://news.online.no/comp.lang.perl.misc";
-print "ok 2\n";
+ok($u->group eq "comp.lang.perl.misc" &&
+ $u->port == 119 &&
+ $u eq "news://news.online.no/comp.lang.perl.misc");
$u->group("no.perl", 1 => 10);
-print "not " unless $u eq "news://news.online.no/no.perl/1-10";
-print "ok 3\n";
+is($u, "news://news.online.no/no.perl/1-10");
my @g = $u->group;
-#print "G: @g\n";
-print "not " unless @g == 3 && "@g" eq "no.perl 1 10";
-print "ok 4\n";
+is_deeply(\@g, ["no.perl", 1, 10]);
$u->message('42@g.aas.no');
#print "$u\n";
-print "not " unless $u->message eq '42@g.aas.no' &&
- !defined($u->group) &&
- $u eq 'news://news.online.no/42@g.aas.no';
-print "ok 5\n";
+ok($u->message eq '42@g.aas.no' &&
+ !defined($u->group) &&
+ $u eq 'news://news.online.no/42@g.aas.no');
$u = URI->new("nntp:no.perl");
-print "not " unless $u->group eq "no.perl" &&
- $u->port == 119;
-print "ok 6\n";
+ok($u->group eq "no.perl" &&
+ $u->port == 119);
$u = URI->new("snews://snews.online.no/no.perl");
-print "not " unless $u->group eq "no.perl" &&
- $u->host eq "snews.online.no" &&
- $u->port == 563;
-print "ok 7\n";
+ok($u->group eq "no.perl" &&
+ $u->host eq "snews.online.no" &&
+ $u->port == 563);
$u = URI->new("nntps://nntps.online.no/no.perl");
-print "not " unless $u->group eq "no.perl" &&
- $u->host eq "nntps.online.no" &&
- $u->port == 563;
-print "ok 8\n";
+ok($u->group eq "no.perl" &&
+ $u->host eq "nntps.online.no" &&
+ $u->port == 563);