This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mktables: Add error check
[perl5.git] / lib / diagnostics.t
index f30f70e..ee0c160 100644 (file)
@@ -5,7 +5,7 @@ BEGIN {
     @INC = 'lib';
 }
 
-use Test::More tests => 2;
+use Test::More tests => 3;
 
 BEGIN { use_ok('diagnostics') }
 
@@ -16,3 +16,10 @@ eval {
 };
 
 like( $@, qr/^Base class package "I::do::not::exist" is empty/);
+
+# Test for %.0f patterns in perldiag, added in 5.11.0
+close STDERR;
+open STDERR, ">", \my $warning
+    or die "Couldn't redirect STDERR to var: $!";
+warn('gmtime(nan) too large');
+like $warning, qr/\(W overflow\) You called/, '%0.f patterns';