blessed.t

来自「source of perl for linux application,」· T 代码 · 共 32 行

T
32
字号
#!./perlBEGIN {    unless (-d 'blib') {	chdir 't' if -d 't';	@INC = '../lib';	require Config; import Config;	keys %Config; # Silence warning	if ($Config{extensions} !~ /\bList\/Util\b/) {	    print "1..0 # Skip: List::Util was not built\n";	    exit 0;	}    }}use Test::More tests => 8;use Scalar::Util qw(blessed);use vars qw($t $x);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');$x = bless {}, "DEF";is(blessed($x), "DEF",	'blessed HASH-ref');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?