File: ref.t

package info (click to toggle)
libautobox-core-perl 1.2-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 328 kB
  • ctags: 161
  • sloc: perl: 567; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 528 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use Test::More qw(no_plan);
use strict;
use warnings;

use autobox::Core;

my %struct = (
    ARRAY  => [ 'foo' ],
    HASH   => { 'foo' => 1 },
    CODE   => sub { 'foo' },
);

foreach my $reftype ( keys %struct ) {
    is $struct{$reftype}->ref, $reftype;
}

TODO: {
    todo_skip "Make it work for Regexp, Scalar and Glob", 3;
    my %todo = (
        Regexp => qr/foo/,
        SCALAR => \'foo',
        GLOB   => \*STDIN,
    );

    foreach my $reftype ( keys %todo ) {
        is $todo{$reftype}->ref, $reftype;
    }
}