projects
/
gitmo/Mouse.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Fix possible memory leaks, which occurs when constructor components throw errors.
[gitmo/Mouse.git]
/
t
/
900_mouse_bugs
/
006_RT69939.t
1
#!perl -w
2
3
use Test::More;
4
5
BEGIN {
6
if($^O =~ /bsd/) {
7
plan skip_all => q{TODO: *bsd might fail on this tests (this test is an workaround to a core bug)};
8
}
9
}
10
11
package Foo;
12
use Mouse;
13
14
has bar => (
15
is => 'rw',
16
17
trigger => sub {
18
eval 'BEGIN{ die }';
19
},
20
default => sub {
21
eval 'BEGIN{ die }';
22
return 42;
23
},
24
);
25
26
sub BUILDARGS {
27
eval 'BEGIN{ die }';
28
return {};
29
}
30
31
sub BUILD {
32
eval 'BEGIN{ die }';
33
}
34
35
package main;
36
37
use Test::More tests => 3;
38
39
$@ = '(ERRSV)';
40
41
my $foo = Foo->new;
42
isa_ok $foo, 'Foo';
43
is $foo->bar, 42;
44
$foo->bar(100);
45
is $foo->bar, 100;
46
note("\$@=$@");