BEGIN {
chdir 't' if -d 't';
- unshift @INC, '../lib';
+ @INC = '../lib';
eval 'require attrs; 1' or do {
print "1..0\n";
exit 0;
}
}
+use warnings;
+no warnings qw(deprecated); # else attrs cries.
+
sub NTESTS () ;
-my $test, $ntests;
+my ($test, $ntests);
BEGIN {$ntests=0}
$test=0;
my $failed = 0;
print "ok ",++$test,"\n";
BEGIN {++$ntests}
+{
+ my $w = "" ;
+ local $SIG{__WARN__} = sub {$w = shift} ;
+ eval 'sub w1 ($) { use warnings "deprecated"; use attrs "locked"; $_[0]++ }';
+ (print "not "), $failed=1 if $@;
+ print "ok ",++$test,"\n";
+ BEGIN {++$ntests}
+ (print "not "), $failed=1
+ if $w !~ /^pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead at/;
+ print "ok ",++$test,"\n";
+ BEGIN {++$ntests}
+}
+
# Other tests should be added above this line