File: pkg_symbol.t

package info (click to toggle)
libnamespace-sweep-perl 0.006-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152 kB
  • sloc: perl: 243; makefile: 2
file content (47 lines) | stat: -rw-r--r-- 799 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env perl

use strict;
use warnings;

use Test::More tests => 11;

package Blurns; {
    no strict;
    use namespace::sweep;
    use Scalar::Util 'reftype';

    $ball = 'fun';
    @loaded = ( 1, 2, 3 );
    %infield_blurn = ( in_effect => 1 );

    $reftype = 42;
    
    sub method { 
        1;
    }

    sub method2 { 
        return 'the infield blurn rule is ' 
          . ( $infield_blurn{in_effect} ? 'in effect' : 'not in effect' );
    }
}


package main;

my $o = bless { }, 'Blurns';

ok $o;
isa_ok $o, 'Blurns';

ok $o->method;
is $o->method2, 'the infield blurn rule is in effect';

is $Blurns::ball, 'fun';
ok @Blurns::loaded;
is $Blurns::loaded[0], 1;
ok %Blurns::infield_blurn;
ok $Blurns::infield_blurn{in_effect};

ok !$o->can( 'reftype' );
is $Blurns::reftype, 42;