Commit | Line | Data |
33459055 |
1 | BEGIN { |
a9153838 |
2 | if( $ENV{PERL_CORE} ) { |
3 | chdir 't'; |
4 | @INC = '../lib'; |
5 | } |
33459055 |
6 | } |
7 | |
d020a79a |
8 | use strict; |
a9153838 |
9 | use Test::More tests => 12; |
d020a79a |
10 | |
11 | BEGIN { $^W = 1; } |
12 | |
13 | my $warnings = ''; |
a9153838 |
14 | local $SIG{__WARN__} = sub { $warnings .= join '', @_ }; |
d020a79a |
15 | |
16 | is( undef, undef, 'undef is undef'); |
17 | is( $warnings, '', ' no warnings' ); |
18 | |
19 | isnt( undef, 'foo', 'undef isnt foo'); |
20 | is( $warnings, '', ' no warnings' ); |
21 | |
a9153838 |
22 | isnt( undef, '', 'undef isnt an empty string' ); |
23 | isnt( undef, 0, 'undef isnt zero' ); |
24 | |
d020a79a |
25 | like( undef, '/.*/', 'undef is like anything' ); |
26 | is( $warnings, '', ' no warnings' ); |
27 | |
28 | eq_array( [undef, undef], [undef, 23] ); |
29 | is( $warnings, '', 'eq_array() no warnings' ); |
30 | |
31 | eq_hash ( { foo => undef, bar => undef }, |
32 | { foo => undef, bar => 23 } ); |
33 | is( $warnings, '', 'eq_hash() no warnings' ); |
34 | |
35 | eq_set ( [undef, undef, 12], [29, undef, undef] ); |
36 | is( $warnings, '', 'eq_set() no warnings' ); |
37 | |
38 | |
39 | eq_hash ( { foo => undef, bar => { baz => undef, moo => 23 } }, |
40 | { foo => undef, bar => { baz => undef, moo => 23 } } ); |
41 | is( $warnings, '', 'eq_hash() no warnings' ); |
42 | |
43 | |