"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cpan/Scalar-List-Utils/t/blessed.t" between
perl-5.32.0-RC0.tar.xz and perl-5.32.0-RC1.tar.xz

About: Perl (Practical Extraction and Report Language) is a high-level, general-purpose, interpreted, dynamic programming language. Release candidate.

blessed.t  (perl-5.32.0-RC0.tar.xz):blessed.t  (perl-5.32.0-RC1.tar.xz)
#!./perl #!./perl
use strict; use strict;
use warnings; use warnings;
use Test::More tests => 12; use Test::More tests => 12;
use Scalar::Util qw(blessed); use Scalar::Util qw(blessed);
my $t; my $t;
ok(!defined blessed(undef), 'undef is not blessed'); ok(!defined blessed(undef), 'undef is not blessed');
ok(!defined blessed(1), 'Numbers are not blessed'); ok(!defined blessed(1), 'Numbers are not blessed');
ok(!defined blessed('A'), 'Strings are not blessed'); ok(!defined blessed('A'), 'Strings are not blessed');
ok(!defined blessed({}), 'Unblessed HASH-ref'); ok(!defined blessed({}), 'Unblessed HASH-ref');
ok(!defined blessed([]), 'Unblessed ARRAY-ref'); ok(!defined blessed([]), 'Unblessed ARRAY-ref');
ok(!defined blessed(\$t), 'Unblessed SCALAR-ref'); ok(!defined blessed(\$t), 'Unblessed SCALAR-ref');
my $x; my $x;
$x = bless [], "ABC"; $x = bless [], "ABC";
is(blessed($x), "ABC", 'blessed ARRAY-ref'); is(blessed($x), "ABC", 'blessed ARRAY-ref');
$x = bless {}, "DEF"; $x = bless {}, "DEF";
is(blessed($x), "DEF", 'blessed HASH-ref'); is(blessed($x), "DEF", 'blessed HASH-ref');
$x = bless {}, "0"; $x = bless {}, "0";
cmp_ok(blessed($x), "eq", "0", 'blessed HASH-ref'); cmp_ok(blessed($x), "eq", "0", 'blessed HASH-ref');
{ {
my $blessed = do { my $blessed = do {
my $depth; my $depth;
no warnings 'redefine'; no warnings 'redefine';
local *UNIVERSAL::can = sub { die "Burp!" if ++$depth > 2; blessed(shift) }; local *UNIVERSAL::can = sub { die "Burp!" if ++$depth > 2; blessed(shift) };
$x = bless {}, "DEF"; $x = bless {}, "DEF";
blessed($x); blessed($x);
}; };
is($blessed, "DEF", 'recursion of UNIVERSAL::can'); is($blessed, "DEF", 'recursion of UNIVERSAL::can');
 End of changes. 4 change blocks. 
9 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)