File: magic-readonly.t

package info (click to toggle)
libref-util-perl 0.204-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 252 kB
  • sloc: perl: 610; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use strict;
use warnings;
use Test::More;
use Ref::Util qw<is_hashref is_plain_hashref is_blessed_hashref>;

eval { require Readonly; Readonly->import; 1; }
or plan 'skip_all' => 'Readonly is required for this test';

plan 'tests' => 3;

Readonly::Scalar( my $rh2 => { a => { b => 2 } } );

ok( is_hashref($rh2), 'Readonly objects work!' );
ok( is_plain_hashref($rh2), 'They are not plain!' );
ok( !is_blessed_hashref($rh2), 'They are blessed!' );