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

Time#getlocal tests for [Feature #17544]

This commit is contained in:
Nobuyoshi Nakada 2021-06-15 21:39:34 +09:00
parent b32e6c168a
commit d09f097eec
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -1228,6 +1228,16 @@ class TestTime < Test::Unit::TestCase
}
end
def test_getlocal_utc
t = Time.gm(2000)
assert_equal [00, 00, 00, 1, 1, 2000], (t1 = t.getlocal("UTC")).to_a[0, 6]
assert_predicate t1, :utc?
assert_equal [00, 00, 00, 1, 1, 2000], (t1 = t.getlocal("-0000")).to_a[0, 6]
assert_predicate t1, :utc?
assert_equal [00, 00, 00, 1, 1, 2000], (t1 = t.getlocal("+0000")).to_a[0, 6]
assert_not_predicate t1, :utc?
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]