summaryrefslogtreecommitdiff
path: root/t/exceptions/frame-leak.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
commit5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch)
tree298c3d2f08bdfe5689998b11892d72a897985be1 /t/exceptions/frame-leak.t
downloadMoose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz
Diffstat (limited to 't/exceptions/frame-leak.t')
-rw-r--r--t/exceptions/frame-leak.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/exceptions/frame-leak.t b/t/exceptions/frame-leak.t
new file mode 100644
index 0000000..e11bd63
--- /dev/null
+++ b/t/exceptions/frame-leak.t
@@ -0,0 +1,23 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Fatal;
+use Test::Requires 'Test::Memory::Cycle';
+
+BEGIN {
+ plan skip_all => 'Leak tests fail under Devel::Cover' if $INC{'Devel/Cover.pm'};
+}
+
+{
+ package Foo;
+ use Moose;
+ has myattr => ( is => 'ro', required => 1 );
+}
+
+memory_cycle_ok(
+ exception { Foo->new() },
+ 'exception objects do not leak arguments into Devel::StackTrace objects',
+);
+
+done_testing;