aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-05 22:49:18 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-05 22:49:18 +1300
commit8546feb64ed6d7b6d22b7267d9996cb4e87e3dcb (patch)
tree3e01c050f4dac224397476077205fe0e7d271962
parentAdd a test to cover a missing branch (diff)
downloadList-Breakdown-8546feb64ed6d7b6d22b7267d9996cb4e87e3dcb.tar.gz
List-Breakdown-8546feb64ed6d7b6d22b7267d9996cb4e87e3dcb.zip
Add comments for t/errors.t tests
-rw-r--r--t/errors.t10
1 files changed, 9 insertions, 1 deletions
diff --git a/t/errors.t b/t/errors.t
index 11a7658..fb083cc 100644
--- a/t/errors.t
+++ b/t/errors.t
@@ -12,12 +12,20 @@ our $VERSION = '0.13';
my @t = 1 .. 3;
+# The wrong kind of reference as a spec is fatal
is( eval { breakdown [ a => 'a' ], @t } || undef,
undef, 'error_wrongref_spec' );
+# An undefined value in spec hashref is fatal
is( eval { breakdown { a => undef }, @t } || undef,
undef, 'error_notref_undef' );
+
+# A non-reference value in spec hashref is fatal
is( eval { breakdown { a => 'a' }, @t } || undef, undef, 'error_notref_def' );
-is( eval { breakdown { a => [] }, @t } || undef, undef, 'error_badref_array' );
+
+# The wrong kind of reference as a value in spec hashref is fatal
+is( eval { breakdown { a => [] }, @t } || undef, undef, 'error_badref_array' );
+
+# A double reference as a value in a spec hashref is fatal
is( eval { breakdown { a => \{} }, @t } || undef, undef,
'error_badref_double' );