summaryrefslogtreecommitdiff
path: root/ext/Errno
diff options
context:
space:
mode:
authorJames E Keenan <jkeenan@cpan.org>2022-08-06 20:45:29 +0000
committerJames E Keenan <jkeenan@cpan.org>2022-08-09 12:27:07 +0000
commit1b5a220440d875d11b90b09072c10e1de8c9420a (patch)
treef7d3efea5996a1a70fa2e975ea4b7a21dc19561a /ext/Errno
parent00b42049cd2abeb11d2831eec4e351cf053aeb36 (diff)
downloadperl-1b5a220440d875d11b90b09072c10e1de8c9420a.tar.gz
Errno.t: provide labels for tests lacking them
Improve test descriptions, with feedback from Tony Cook.
Diffstat (limited to 'ext/Errno')
-rw-r--r--ext/Errno/t/Errno.t22
1 files changed, 13 insertions, 9 deletions
diff --git a/ext/Errno/t/Errno.t b/ext/Errno/t/Errno.t
index 3baaf60c4c..66133dd3d3 100644
--- a/ext/Errno/t/Errno.t
+++ b/ext/Errno/t/Errno.t
@@ -14,29 +14,33 @@ BAIL_OUT("No errno's are exported") unless @Errno::EXPORT_OK;
my $err = $Errno::EXPORT_OK[0];
my $num = &{"Errno::$err"};
-is($num, &{"Errno::$err"});
+is($num, &{"Errno::$err"},
+ 'element in @Errno::EXPORT_OK found via sub call');
$! = $num;
-ok(exists $!{$err});
+ok(exists $!{$err}, 'entry in %! reflects current value of $!');
$! = 0;
-ok(! $!{$err});
+ok(! $!{$err}, 'entry in %! reflects the current value of $!');
-ok(join(",",sort keys(%!)) eq join(",",sort @Errno::EXPORT_OK));
+ok(join(",",sort keys(%!)) eq join(",",sort @Errno::EXPORT_OK),
+ 'keys of %! match keys of @Errno::EXPORT_OK');
eval { exists $!{[]} };
-ok(! $@);
+ok(! $@, "no exception recorded in %! when element's key is '[]'");
eval {$!{$err} = "qunckkk" };
-like($@, qr/^ERRNO hash is read only!/);
+like($@, qr/^ERRNO hash is read only!/,
+ "can't assign to ERRNO hash: 'ERRNO hash is read only!'");
eval {delete $!{$err}};
-like($@, qr/^ERRNO hash is read only!/);
+like($@, qr/^ERRNO hash is read only!/,
+ "can't delete from ERRNO hash: 'ERRNO hash is read only!'");
# The following tests are in trouble if some OS picks errno values
# through Acme::MetaSyntactic::batman
-is($!{EFLRBBB}, "");
-ok(! exists($!{EFLRBBB}));
+is($!{EFLRBBB}, "", "non-existent entry in ERRNO hash");
+ok(! exists($!{EFLRBBB}), "non-existent entry in ERRNO hash");
SKIP: {
skip("Errno does not have EINVAL", 1)