warnings.t

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

T
33
字号
#!/usr/bin/perl -wBEGIN {   if( $ENV{PERL_CORE} ) {        chdir 't' if -d 't';        @INC = qw(../lib);    }}use strict;use Test::More tests => 1;my $warnings;BEGIN {    $SIG{__WARN__} = sub { $warnings = join '', @_ };}{    package Foo;    use fields qw(thing);}{    package Bar;    use fields qw(stuff);    use base qw(Foo);}::like $warnings,       '/^Bar is inheriting from Foo but already has its own fields!/',       'Inheriting from a base with protected fields warns';

⌨️ 快捷键说明

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