- or download this
$ perl -Moose -e'has a=>(is=>"rw",isa=>"Undef",coerce=>1); __PACKAGE__
+->new(a=>"abc")'
Attribute (a) does not pass the type constraint because: Validation fa
+iled for 'Undef' failed with value abc at [snip backtrace]
...
$ perl -Moose -e'has a=>(is=>"rw",isa=>"Undef|Undef",coerce=>0); __PAC
+KAGE__->new(a=>"abc")'
Attribute (a) does not pass the type constraint because: Validation fa
+iled for 'Undef|Undef' failed with value abc at [snip backtrace]
- or download this
BEGIN {
package Class;
...
eval { $c->union($o) }; is($@, ''); ok(tu($c));
eval { $c->union(123) }; is($@, ''); ok(tu($c));
eval { $c->union("abc") }; like($@, $union_fail); ok(tu($c));
- or download this
$ perl a.pl
1..30
...
ok 30
# Looks like you failed 3 tests of 30.