diff options
author | doy <doy@tozt.net> | 2008-12-06 23:39:24 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2008-12-06 23:39:24 -0500 |
commit | 6bbd36711c3a8ddc93a949b1c254ce33824659d4 (patch) | |
tree | 57ace73ef3c2cf21635c32ebfa05e2a91ff0725e /t/001-basic-matching.t | |
parent | a79bf3fb60ae2a98e17ed8bb1144a28eec8849f3 (diff) | |
download | moosex-role-matcher-6bbd36711c3a8ddc93a949b1c254ce33824659d4.tar.gz moosex-role-matcher-6bbd36711c3a8ddc93a949b1c254ce33824659d4.zip |
test matching against undef
Diffstat (limited to 't/001-basic-matching.t')
-rw-r--r-- | t/001-basic-matching.t | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/t/001-basic-matching.t b/t/001-basic-matching.t index c9c589c..52003ac 100644 --- a/t/001-basic-matching.t +++ b/t/001-basic-matching.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 4; +use Test::More tests => 5; package Foo; use Moose; @@ -10,7 +10,6 @@ with 'MooseX::Role::Matcher'; has [qw/a b c/] => ( is => 'ro', isa => 'Str', - required => 1, ); package main; @@ -23,3 +22,6 @@ ok($foo->match(b => sub { length(shift) == 3 }), 'subroutine matching works'); ok($foo->match(a => 'foo', b => qr/a/, c => sub { substr(shift, 2) eq 'z' }), 'combined matching works'); +$foo = Foo->new(a => 'foo'); +ok($foo->match(a => 'foo', b => undef), + 'matching against undef works'); |