Commit | Line | Data |
6444f23a |
1 | use warnings; |
2 | use strict; |
3 | |
726710b6 |
4 | use lib 't/lib'; |
6444f23a |
5 | use Test::More tests => 17; |
6 | |
7 | our $pvio; |
8 | |
9 | use_ok('OtherTypes'); |
10 | |
11 | # Since we use use_ok, this is effectively 'compile time'. |
12 | |
13 | ok( defined *OtherTypes::foo{SCALAR}, |
14 | "SCALAR slot intact at compile time" ); |
15 | ok( defined *OtherTypes::foo{ARRAY}, |
16 | "ARRAY slot intact at compile time" ); |
17 | ok( defined *OtherTypes::foo{HASH}, |
18 | "HASH slot intact at compile time" ); |
19 | ok( defined *OtherTypes::foo{IO}, |
20 | "IO slot intact at compile time" ); |
21 | |
22 | is( $OtherTypes::foo, 23, |
23 | "SCALAR slot correct at compile time" ); |
24 | is( $OtherTypes::foo[0], "bar", |
25 | "ARRAY slot correct at compile time" ); |
26 | is( $OtherTypes::foo{mouse}, "trap", |
27 | "HASH slot correct at compile time" ); |
28 | is( *OtherTypes::foo{IO}, $pvio, |
29 | "IO slot correct at compile time" ); |
30 | |
31 | eval q{ |
32 | ok( defined *OtherTypes::foo{SCALAR}, |
33 | "SCALAR slot intact at run time" ); |
34 | ok( defined *OtherTypes::foo{ARRAY}, |
35 | "ARRAY slot intact at run time" ); |
36 | ok( defined *OtherTypes::foo{HASH}, |
37 | "HASH slot intact at run time" ); |
38 | ok( defined *OtherTypes::foo{IO}, |
39 | "IO slot intact at run time" ); |
40 | |
41 | is( $OtherTypes::foo, 23, |
42 | "SCALAR slot correct at run time" ); |
43 | is( $OtherTypes::foo[0], "bar", |
44 | "ARRAY slot correct at run time" ); |
45 | is( $OtherTypes::foo{mouse}, "trap", |
46 | "HASH slot correct at run time" ); |
47 | is( *OtherTypes::foo{IO}, $pvio, |
48 | "IO slot correct at run time" ); |
49 | }; |