From: Jerry D. Hedden Date: Fri, 13 Mar 2009 13:37:24 +0000 (-0400) Subject: Tests for floating point args to localtime and gmtime X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=43eb98159eec9ba37935203e5bf9f3a4199380c5;p=p5sagit%2Fp5-mst-13.2.git Tests for floating point args to localtime and gmtime --- diff --git a/t/op/time.t b/t/op/time.t old mode 100755 new mode 100644 index 00c5b05..89ea04b --- a/t/op/time.t +++ b/t/op/time.t @@ -6,7 +6,7 @@ BEGIN { require './test.pl'; } -plan tests => 42; +plan tests => 44; ($beguser,$begsys) = times; @@ -130,3 +130,17 @@ ok(gmtime() =~ /^(Sun|Mon|Tue|Wed|Thu|Fri|Sat)[ ] like scalar localtime($time), $scalar, " scalar"; } } + +# Test floating point args +{ + eval { + $SIG{__WARN__} = sub { die @_; }; + localtime(1.23); + }; + is($@, '', 'Ignore fractional time'); + eval { + $SIG{__WARN__} = sub { die @_; }; + gmtime(1.23); + }; + is($@, '', 'Ignore fractional time'); +}