diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-24 15:49:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-24 15:49:43 +0000 |
commit | dc54e380415cfdf442dafbc6ede8ab433af41fe2 (patch) | |
tree | 4159315b0f6e7881b79fb93bb32ee8e1f02a5af3 /test/ruby/test_time.rb | |
parent | 24602147809f793d9e4086bd2f2e732a35264fb8 (diff) |
strftime.c: Bignum conversion
* strftime.c (format_value): convert from Bignum to String,
instead of rb_str_format.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_time.rb')
-rw-r--r-- | test/ruby/test_time.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index c75cffaacf..c7d4487553 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -680,6 +680,12 @@ class TestTime < Test::Unit::TestCase t = Time.at(946684800, 123456.789) assert_equal("946684800", t.strftime("%s")) assert_equal("946684800", t.utc.strftime("%s")) + + t = Time.at(10000000000000000000000) + assert_equal("<<10000000000000000000000>>", t.strftime("<<%s>>")) + assert_equal("<<010000000000000000000000>>", t.strftime("<<%24s>>")) + assert_equal("<<010000000000000000000000>>", t.strftime("<<%024s>>")) + assert_equal("<< 10000000000000000000000>>", t.strftime("<<%_24s>>")) end def test_strftime_zone @@ -759,6 +765,9 @@ class TestTime < Test::Unit::TestCase t = Time.utc(10000000000000000000000,1,1) assert_equal("<<10000000000000000000000>>", t.strftime("<<%Y>>")) + assert_equal("<<010000000000000000000000>>", t.strftime("<<%24Y>>")) + assert_equal("<<010000000000000000000000>>", t.strftime("<<%024Y>>")) + assert_equal("<< 10000000000000000000000>>", t.strftime("<<%_24Y>>")) end def test_strftime_weeknum |