Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add testcase.

  • Loading branch information...
commit 2b1b5d1804faf084db02814514a45e376084e78b 1 parent c7d8e0c
@NetPenguin authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 t/01.total.t
View
13 t/01.total.t
@@ -14,11 +14,11 @@ BEGIN {
});
}
use Test::Deep qw(ignore);
-use Test::LeakTrace;
+use Scalar::Util qw(weaken);
# ----
# Tests.
-subtest 'default mock' => sub { no_leaks_ok {
+subtest 'default mock' => sub {
my $mock = create_mock();
subtest 'array arguments and array result' => sub {
@@ -184,7 +184,14 @@ subtest 'default mock' => sub { no_leaks_ok {
replay($mock);
verify($mock); # pass
};
-} 'no memory leaks'; };
+
+ subtest 'destroy mock object' => sub {
+ my $weak_ref_mock = $mock;
+ weaken($weak_ref_mock);
+ undef($mock);
+ is($weak_ref_mock, undef, 'mock is destroied.');
+ };
+};
# ----
Please sign in to comment.
Something went wrong with that request. Please try again.