File: ident.t

package info (click to toggle)
libclass-std-utils-perl 0.0.3-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 100 kB
  • sloc: perl: 32; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 483 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 Scalar::Util 'refaddr';
use Class::Std::Utils;
use Test::More 'no_plan';

my @objects = (
    do{\my $scalar},
    { hash => 'anon' },
    [ 1..10 ],
    sub {},
    qr//,
);

for my $ref (@objects) {
    is ident $ref, refaddr $ref   => 'ident acts like refaddr on '.ref $ref;
    is ident $ref, int $ref       => 'ident acts like int on '.ref $ref;
}

bless $_ for @objects;

for my $ref (@objects) {
    is ident $ref, refaddr $ref   => 'ident acts like refaddr on object';
}