From 5a628e820f57eae410fcceab949deef90887a384 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 10 Oct 2022 19:38:19 +0200 Subject: test cleanups Make a few small test cleanups. Use done_testing rather than an explicit plan in escape.t and scheme-exceptions.t and remove the bogus +x on path-segments.t Also update scheme-exceptions.t to use a more obviously invalid URI scheme. --- t/escape.t | 4 +++- t/path-segments.t | 0 t/scheme-exceptions.t | 9 +++++---- 3 files changed, 8 insertions(+), 5 deletions(-) mode change 100755 => 100644 t/path-segments.t diff --git a/t/escape.t b/t/escape.t index 63dfb06..d78155b 100644 --- a/t/escape.t +++ b/t/escape.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 21; +use Test::More; use URI::Escape qw( %escapes uri_escape uri_escape_utf8 uri_unescape ); @@ -83,3 +83,5 @@ ok !eval { print uri_escape("abc" . chr(300)); 1 }; like $@, qr/^Can\'t escape \\x\{012C\}, try uri_escape_utf8\(\) instead/; is uri_escape_utf8(chr(0xFFF)), "%E0%BF%BF"; + +done_testing; diff --git a/t/path-segments.t b/t/path-segments.t old mode 100755 new mode 100644 diff --git a/t/scheme-exceptions.t b/t/scheme-exceptions.t index e1cb568..e400591 100644 --- a/t/scheme-exceptions.t +++ b/t/scheme-exceptions.t @@ -4,13 +4,14 @@ use warnings; use Test::More; use URI (); -plan skip_all => 'this test assumes that URI::javascript does not exist' - if eval { +require URI::javascript }; -plan tests => 4; +plan skip_all => 'this test assumes that URI::notreal does not exist' + if eval { +require URI::notreal }; for (0..1) { - my $uri = URI->new('javascript://foo/bar'); + my $uri = URI->new('notreal://foo/bar'); is($@, '', 'no exception when trying to load a scheme handler class'); ok($uri->isa('URI'), 'but URI still instantiated as foreign'); } + +done_testing; -- cgit v1.2.1