Get tests running under -T (cosmetics only)
[p5sagit/namespace-clean.git] / t / 06-other-types.t
CommitLineData
6444f23a 1use warnings;
2use strict;
3
726710b6 4use lib 't/lib';
6444f23a 5use Test::More tests => 17;
6
7our $pvio;
8
9use_ok('OtherTypes');
10
11# Since we use use_ok, this is effectively 'compile time'.
12
13ok( defined *OtherTypes::foo{SCALAR},
14 "SCALAR slot intact at compile time" );
15ok( defined *OtherTypes::foo{ARRAY},
16 "ARRAY slot intact at compile time" );
17ok( defined *OtherTypes::foo{HASH},
18 "HASH slot intact at compile time" );
19ok( defined *OtherTypes::foo{IO},
20 "IO slot intact at compile time" );
21
22is( $OtherTypes::foo, 23,
23 "SCALAR slot correct at compile time" );
24is( $OtherTypes::foo[0], "bar",
25 "ARRAY slot correct at compile time" );
26is( $OtherTypes::foo{mouse}, "trap",
27 "HASH slot correct at compile time" );
28is( *OtherTypes::foo{IO}, $pvio,
29 "IO slot correct at compile time" );
30
31eval 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};