Add a test
[gitmo/Mouse.git] / t / 900_mouse_bugs / 006_RT69939.t
index 680dee8..e2cb03e 100644 (file)
@@ -1,5 +1,13 @@
 #!perl -w
 
+use Test::More;
+
+BEGIN {
+    if($^O =~ /bsd/) {
+        plan skip_all => q{TODO: *bsd might fail on this tests (this test is an workaround to a core bug)};
+    }
+}
+
 package Foo;
 use Mouse;
 
@@ -26,13 +34,36 @@ sub BUILD {
 
 package main;
 
-use Test::More tests => 3;
+use Test::More tests => 3 * 3;
 
 $@ = '(ERRSV)';
 
-my $foo = Foo->new;
-isa_ok $foo, 'Foo';
-is $foo->bar, 42;
-$foo->bar(100);
-is $foo->bar, 100;
-note("\$@=$@");
+note 'do {}';
+do {
+    my $foo = Foo->new;
+    isa_ok $foo, 'Foo';
+    is $foo->bar, 42;
+    $foo->bar(100);
+    is $foo->bar, 100;
+    note("\$@=$@");
+};
+
+note 'eval {}';
+eval {
+    my $foo = Foo->new;
+    isa_ok $foo, 'Foo';
+    is $foo->bar, 42;
+    $foo->bar(100);
+    is $foo->bar, 100;
+    note("\$@=$@");
+};
+
+note 'eval ""';
+eval q{
+    my $foo = Foo->new;
+    isa_ok $foo, 'Foo';
+    is $foo->bar, 42;
+    $foo->bar(100);
+    is $foo->bar, 100;
+    note("\$@=$@");
+};