File: arrayref.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 (17 lines) | stat: -rw-r--r-- 475 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use warnings;
use Test::More tests => 7;

BEGIN {
    use_ok('Ref::Util');
    Ref::Util->import('is_arrayref');
}

can_ok( Ref::Util::, 'is_arrayref' );
Ref::Util::is_arrayref(\1);

ok( !is_arrayref(\1), 'Correctly identify scalarref' );
ok( !is_arrayref({}), 'Correctly identify hashref' );
ok( !is_arrayref(sub {}), 'Correctly identify coderef' );
ok( !is_arrayref(qr//), 'Correctly identify regexpref' );
ok( is_arrayref([]), 'Correctly identify arrayref' );