Commit | Line | Data |
f4a2945e |
1 | BEGIN { |
2 | chdir 't' if -d 't'; |
3 | @INC = '../lib'; |
6b05f64e |
4 | require Config; import Config; |
5 | if ($Config{extensions} !~ /\bList\/Util\b/) { |
6 | print "1..0 # Skip: List::Util was not built\n"; |
7 | exit 0; |
8 | } |
f4a2945e |
9 | } |
10 | |
11 | use Scalar::Util qw(blessed); |
12 | use vars qw($t $y $x); |
13 | |
14 | print "1..7\n"; |
15 | |
16 | print "not " if blessed(1); |
17 | print "ok 1\n"; |
18 | |
19 | print "not " if blessed('A'); |
20 | print "ok 2\n"; |
21 | |
22 | print "not " if blessed({}); |
23 | print "ok 3\n"; |
24 | |
25 | print "not " if blessed([]); |
26 | print "ok 4\n"; |
27 | |
28 | $y = \$t; |
29 | |
30 | print "not " if blessed($y); |
31 | print "ok 5\n"; |
32 | |
33 | $x = bless [], "ABC"; |
34 | |
35 | print "not " unless blessed($x); |
36 | print "ok 6\n"; |
37 | |
38 | print "not " unless blessed($x) eq 'ABC'; |
39 | print "ok 7\n"; |