зеркало из https://github.com/github/ruby.git
Added tests for Time#getlocal with UTC offset
This commit is contained in:
Родитель
0644f466b0
Коммит
f4be7a510e
|
@ -1212,6 +1212,14 @@ class TestTime < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_getlocal_utc_offset
|
||||
t = Time.gm(2000)
|
||||
assert_equal [00, 30, 21, 31, 12, 1999], t.getlocal("-02:30").to_a[0, 6]
|
||||
assert_equal [00, 00, 9, 1, 1, 2000], t.getlocal("+09:00").to_a[0, 6]
|
||||
assert_equal [20, 29, 21, 31, 12, 1999], t.getlocal("-02:30:40").to_a[0, 6]
|
||||
assert_equal [35, 10, 9, 1, 1, 2000], t.getlocal("+09:10:35").to_a[0, 6]
|
||||
end
|
||||
|
||||
def test_getlocal_nil
|
||||
now = Time.now
|
||||
now2 = nil
|
||||
|
|
Загрузка…
Ссылка в новой задаче