diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-28 23:31:44 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-28 23:31:44 +0000 |
commit | 6b47d60e1681d643710ef0c1462539cfdcea9877 (patch) | |
tree | d560b96db75e2177b7b66d80d1d2dba0d063e399 /test/test_time.rb | |
parent | aed90c7cae00669436c001cdc747bb0ed93c1e31 (diff) |
* strftime.c (STRFTIME): return 0 and ERANGE when precision is too
large. [ruby-dev:43284] fixes #4456
based on r31011.
* test/test_time.rb (TestTime#test_huge_precision): test for #4456.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_time.rb')
-rw-r--r-- | test/test_time.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_time.rb b/test/test_time.rb index d8468c6c43..d3f3c22dff 100644 --- a/test/test_time.rb +++ b/test/test_time.rb @@ -1,5 +1,6 @@ require 'time' require 'test/unit' +require_relative 'ruby/envutil.rb' class TestTimeExtension < Test::Unit::TestCase # :nodoc: def test_rfc822 @@ -397,4 +398,9 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc: assert_equal(123456789, Time.xmlschema("2000-01-01T00:00:00.123456789+00:00").tv_nsec) assert_equal(123456789, Time.parse("2000-01-01T00:00:00.123456789+00:00").tv_nsec) end + + def test_huge_precision + bug4456 = '[ruby-dev:43284]' + assert_normal_exit %q{ Time.now.strftime("%1000000000F") }, bug4456 + end end |