diff options
author | James Raspass <jraspass@gmail.com> | 2022-08-21 20:48:21 +0100 |
---|---|---|
committer | Olaf Alders <olaf@wundersolutions.com> | 2022-08-22 08:26:51 -0400 |
commit | d58d34967abc31ad7d22a71aa5e15d407d77799a (patch) | |
tree | 68fb1ea013aa4f496a9267260e38b533146572c6 /t/news.t | |
parent | 9cc1f62cb927c7a022f3f3b0d30c6e3f9a06a924 (diff) | |
download | uri-d58d34967abc31ad7d22a71aa5e15d407d77799a.tar.gz |
Replace raw TAP printing with "Test::More"
Diffstat (limited to 't/news.t')
-rw-r--r-- | t/news.t | 51 |
1 files changed, 21 insertions, 30 deletions
@@ -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); |