bless.t
来自「source of perl for linux application,」· T 代码 · 共 42 行
T
42 行
#!perluse Test::More 0.60;# Test::More 0.60 required because:# - is_deeply(undef, $not_undef); now works. [rt.cpan.org 9441]BEGIN { plan tests => 1+4*2; }BEGIN { use_ok('Data::Dumper') };# RT 39420: Data::Dumper fails to escape bless class name# test under XS and pure Perl versionforeach $Data::Dumper::Useperl (0, 1) {#diag("\$Data::Dumper::Useperl = $Data::Dumper::Useperl");{my $t = bless( {}, q{a'b} );my $dt = Dumper($t);my $o = <<'PERL';$VAR1 = bless( {}, 'a\'b' );PERLis($dt, $o, "package name in bless is escaped if needed");is_deeply(scalar eval($dt), $t, "eval reverts dump");}{my $t = bless( {}, q{a\\} );my $dt = Dumper($t);my $o = <<'PERL';$VAR1 = bless( {}, 'a\\' );PERLis($dt, $o, "package name in bless is escaped if needed");is_deeply(scalar eval($dt), $t, "eval reverts dump");}}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?