Trial release to smoketest the hinthash handling changes
[p5sagit/namespace-clean.git] / t / 06-other-types.t
CommitLineData
6444f23a 1#!/usr/bin/env perl
2use warnings;
3use strict;
4
5use FindBin;
6use lib "$FindBin::Bin/lib";
7use Test::More tests => 17;
8
9our $pvio;
10
11use_ok('OtherTypes');
12
13# Since we use use_ok, this is effectively 'compile time'.
14
15ok( defined *OtherTypes::foo{SCALAR},
16 "SCALAR slot intact at compile time" );
17ok( defined *OtherTypes::foo{ARRAY},
18 "ARRAY slot intact at compile time" );
19ok( defined *OtherTypes::foo{HASH},
20 "HASH slot intact at compile time" );
21ok( defined *OtherTypes::foo{IO},
22 "IO slot intact at compile time" );
23
24is( $OtherTypes::foo, 23,
25 "SCALAR slot correct at compile time" );
26is( $OtherTypes::foo[0], "bar",
27 "ARRAY slot correct at compile time" );
28is( $OtherTypes::foo{mouse}, "trap",
29 "HASH slot correct at compile time" );
30is( *OtherTypes::foo{IO}, $pvio,
31 "IO slot correct at compile time" );
32
33eval q{
34 ok( defined *OtherTypes::foo{SCALAR},
35 "SCALAR slot intact at run time" );
36 ok( defined *OtherTypes::foo{ARRAY},
37 "ARRAY slot intact at run time" );
38 ok( defined *OtherTypes::foo{HASH},
39 "HASH slot intact at run time" );
40 ok( defined *OtherTypes::foo{IO},
41 "IO slot intact at run time" );
42
43 is( $OtherTypes::foo, 23,
44 "SCALAR slot correct at run time" );
45 is( $OtherTypes::foo[0], "bar",
46 "ARRAY slot correct at run time" );
47 is( $OtherTypes::foo{mouse}, "trap",
48 "HASH slot correct at run time" );
49 is( *OtherTypes::foo{IO}, $pvio,
50 "IO slot correct at run time" );
51};