diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-30 07:10:55 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-30 07:10:55 +0000 |
commit | 2418e5ca83f863b58a9e13caefc9a23414cae49c (patch) | |
tree | 7a17ed7568b11f3d56216ad93265e6793f81cf9e /test | |
parent | b4be48e88d74c1e5cce9d68aed30c4e4ef17d7c5 (diff) | |
download | ruby-2418e5ca83f863b58a9e13caefc9a23414cae49c.tar.gz |
* strftime.c (rb_strftime_with_timespec): %G produces 4 digits.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_time.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index ec5395092f..838a7692f7 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -590,6 +590,18 @@ class TestTime < Test::Unit::TestCase assert_equal("02", t.strftime("%0l")) assert_equal(" 2", t.strftime("%_l")) + t = Time.utc(1,1,4) + assert_equal("0001", t.strftime("%Y")) + assert_equal("0001", t.strftime("%G")) + + t = Time.utc(0,1,4) + assert_equal("0000", t.strftime("%Y")) + assert_equal("0000", t.strftime("%G")) + + t = Time.utc(-1,1,4) + assert_equal("-0001", t.strftime("%Y")) + assert_equal("-0001", t.strftime("%G")) + # [ruby-dev:37155] t = Time.mktime(1970, 1, 18) assert_equal("0", t.strftime("%w")) |