diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-28 17:06:20 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-28 17:06:20 +0000 |
commit | 63846d48a9b2044ad2fb3062ca8551de078d3508 (patch) | |
tree | b1691c2811825b84b9da5fd326abcc0d2034dd54 /test | |
parent | c23ec90e813457ec4db5d02677cdb358743974b5 (diff) | |
download | ruby-63846d48a9b2044ad2fb3062ca8551de078d3508.tar.gz |
* strftime.c (rb_strftime): supported %s and %P.
* time.c (time_strftime): ditto.
* test/ruby/test_time.rb (test_strftime): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_time.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index a2c2b1b140..3a9b055802 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -398,6 +398,8 @@ class TestTime < Test::Unit::TestCase assert_equal("1234567890", t.strftime("%10N")) assert_equal("", t.strftime("%0N")) assert_equal("000", t.strftime("%3S")) + assert_equal("946684800", t.strftime("%s")) + assert_equal("946684800", t.utc.strftime("%s")) t = Time.mktime(2001, 10, 1) assert_equal("2001-10-01", t.strftime("%F")) @@ -409,6 +411,10 @@ class TestTime < Test::Unit::TestCase assert_equal(" 1", t.strftime("%e")) assert_equal("01", t.strftime("%0e")) assert_equal(" 1", t.strftime("%_e")) + assert_equal("AM", t.strftime("%p")) + assert_equal("am", t.strftime("%#p")) + assert_equal("am", t.strftime("%P")) + assert_equal("AM", t.strftime("%#P")) assert_equal("02", t.strftime("%H")) assert_equal("02", t.strftime("%0H")) assert_equal(" 2", t.strftime("%_H")) @@ -422,6 +428,10 @@ class TestTime < Test::Unit::TestCase assert_equal("02", t.strftime("%0l")) assert_equal(" 2", t.strftime("%_l")) t = Time.mktime(2001, 10, 1, 14, 0, 0) + assert_equal("PM", t.strftime("%p")) + assert_equal("pm", t.strftime("%#p")) + assert_equal("pm", t.strftime("%P")) + assert_equal("PM", t.strftime("%#P")) assert_equal("14", t.strftime("%H")) assert_equal("14", t.strftime("%0H")) assert_equal("14", t.strftime("%_H")) |