1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add tests of string argument to Time.at

This commit is contained in:
Nobuyoshi Nakada 2021-12-03 18:35:35 +09:00
parent dd6c59cdaf
commit e4c7c5468e
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -37,6 +37,8 @@ class TestTime < Test::Unit::TestCase
end
def test_new
assert_equal(Time.new(2000,1,1,0,0,0), Time.new(2000))
assert_equal(Time.new(2000,2,1,0,0,0), Time.new("2000", "Feb"))
assert_equal(Time.utc(2000,2,10), Time.new(2000,2,10, 11,0,0, 3600*11))
assert_equal(Time.utc(2000,2,10), Time.new(2000,2,9, 13,0,0, -3600*11))
assert_equal(Time.utc(2000,2,29,23,0,0), Time.new(2000, 3, 1, 0, 0, 0, 3600))