File: scalar-util-instance.pl

package info (click to toggle)
libtest-weaken-perl 3.022000-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 372 kB
  • sloc: perl: 3,828; makefile: 24; sh: 6
file content (22 lines) | stat: -rw-r--r-- 434 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;
use Test::Weaken;
use Scalar::Util::Instance
  { for => 'Foo', as => 'is_a_Foo' };

# uncomment this to run the ### lines
use Smart::Comments;

my $tw = Test::Weaken::leaks
  ({ constructor => sub {
       return Scalar::Util::Instance->generate_for('Bar');
     },
   });
### $tw

my $coderef = Scalar::Util::Instance->generate_for('Bar');
### $coderef
Scalar::Util::weaken($coderef);
### $coderef

exit 0;