}
}
+use Test::More tests => 8;
use Scalar::Util qw(blessed);
-use vars qw($t $y $x);
+use vars qw($t $x);
-print "1..7\n";
-
-print "not " if blessed(1);
-print "ok 1\n";
-
-print "not " if blessed('A');
-print "ok 2\n";
-
-print "not " if blessed({});
-print "ok 3\n";
-
-print "not " if blessed([]);
-print "ok 4\n";
-
-$y = \$t;
-
-print "not " if blessed($y);
-print "ok 5\n";
+ok(!blessed(undef), 'undef is not blessed');
+ok(!blessed(1), 'Numbers are not blessed');
+ok(!blessed('A'), 'Strings are not blessed');
+ok(!blessed({}), 'Unblessed HASH-ref');
+ok(!blessed([]), 'Unblessed ARRAY-ref');
+ok(!blessed(\$t), 'Unblessed SCALAR-ref');
$x = bless [], "ABC";
+is(blessed($x), "ABC", 'blessed ARRAY-ref');
-print "not " unless blessed($x);
-print "ok 6\n";
-
-print "not " unless blessed($x) eq 'ABC';
-print "ok 7\n";
+$x = bless {}, "DEF";
+is(blessed($x), "DEF", 'blessed HASH-ref');