aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/errors.t17
-rw-r--r--t/words.t6
2 files changed, 20 insertions, 3 deletions
diff --git a/t/errors.t b/t/errors.t
new file mode 100644
index 0000000..842c344
--- /dev/null
+++ b/t/errors.t
@@ -0,0 +1,17 @@
+#!perl -T
+
+use strict;
+use warnings;
+use utf8;
+
+use Test::More tests => 4;
+
+use List::Filters 'filter';
+
+our $VERSION = 0.05;
+
+my @t = 1 .. 3;
+is( eval { filter { a => undef }, @t } || undef, undef, 'error_notref_undef' );
+is( eval { filter { a => 'a' }, @t } || undef, undef, 'error_notref_def' );
+is( eval { filter { a => [] }, @t } || undef, undef, 'error_badref_array' );
+is( eval { filter { a => \{} }, @t } || undef, undef, 'error_badref_double' );
diff --git a/t/words.t b/t/words.t
index a917a37..a2ca767 100644
--- a/t/words.t
+++ b/t/words.t
@@ -8,10 +8,10 @@ use Test::More tests => 1;
use List::Filters 'filter';
-our $VERSION = 0.04;
+our $VERSION = 0.05;
-my @words = qw(foo bar baz quux wibble florb);
-my $filters = {
+my @words = qw(foo bar baz quux wibble florb);
+my $filters = {
all => sub { 1 },
has_b => sub { m/ b /msx },
has_w => sub { m/ w /msx },