diff _test/Test/DOM/Node.pm @ 188:029c9610528c

Memory leak tests in IMPL::Web::View
author cin
date Tue, 03 Apr 2012 20:08:42 +0400
parents 4267a2ac3d46
children 4d0e1962161c
line wrap: on
line diff
--- a/_test/Test/DOM/Node.pm	Tue Apr 03 07:54:25 2012 +0400
+++ b/_test/Test/DOM/Node.pm	Tue Apr 03 20:08:42 2012 +0400
@@ -3,8 +3,9 @@
 use warnings;
 
 use parent qw(IMPL::Test::Unit);
-use IMPL::Test qw(test shared failed cmparray);
+use IMPL::Test qw(test shared failed cmparray assert);
 use IMPL::Class::Property;
+use Scalar::Util qw(weaken);
 
 require IMPL::DOM::Node;
 
@@ -226,6 +227,13 @@
 	failed "Got wrong list of props", @props unless cmparray(\@props,\@expected);
 };
 
+test MemoryLeaks => sub {
+	my $doc = new IMPL::DOM::Document(nodeName => 'Root');
+	weaken($doc);
+	
+	assert(not defined $doc);
+};
+
 package Test::DOM::TypedNode;
 use parent qw(IMPL::DOM::Node);
 use IMPL::Class::Property;