Import Moose/t/100_bugs
[gitmo/Mouse.git] / t / 100_bugs / 027_constructor_object_overload.t
diff --git a/t/100_bugs/027_constructor_object_overload.t b/t/100_bugs/027_constructor_object_overload.t
new file mode 100644 (file)
index 0000000..0dfba1c
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Test::More tests => 1;
+
+{
+    package Foo;
+
+    use Mouse;
+
+    use overload '""' => sub {''};
+
+    sub bug { 'plenty' }
+
+    __PACKAGE__->meta->make_immutable;
+}
+
+ok(Foo->new()->bug(), 'call constructor on object reference with overloading');
+