Re: [perl #50322] CGITempFile causes "Insecure dependency in sprintf" in perl 5.10.0
[p5sagit/p5-mst-13.2.git] / lib / base / t / warnings.t
CommitLineData
9e998a43 1#!/usr/bin/perl -w
2
39063025 3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 chdir 't' if -d 't';
6 @INC = qw(../lib);
7 }
8}
9
9e998a43 10use strict;
11
12use Test::More tests => 1;
13
14my $warnings;
15BEGIN {
16 $SIG{__WARN__} = sub { $warnings = join '', @_ };
17}
18
19{
20 package Foo;
21 use fields qw(thing);
22}
23
24{
25 package Bar;
26 use fields qw(stuff);
27 use base qw(Foo);
28}
29
30::like $warnings,
31 '/^Bar is inheriting from Foo but already has its own fields!/',
32 'Inheriting from a base with protected fields warns';