From 6bbd36711c3a8ddc93a949b1c254ce33824659d4 Mon Sep 17 00:00:00 2001 From: doy Date: Sat, 6 Dec 2008 23:39:24 -0500 Subject: test matching against undef --- t/001-basic-matching.t | 6 ++++-- 1 file 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'); -- cgit v1.2.3-54-g00ecf