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 | 27695a7f3882ddd9cef0884a7222fd70e6a327e4 (patch) | |
tree | 4159315b0f6e7881b79fb93bb32ee8e1f02a5af3 /test | |
parent | ed3fddeddd3b1432b6b73ba2f6497fb60c4110c6 (diff) | |
download | ruby-27695a7f3882ddd9cef0884a7222fd70e6a327e4.tar.gz |
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')
-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 |