summaryrefslogtreecommitdiff
path: root/test/ruby/test_time.rb
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2021-02-01 19:05:57 +0900
committerNARUSE, Yui <naruse@airemix.jp>2021-02-01 19:05:57 +0900
commit5501e1038eb1f606d4b941115fcc45e6e01a0de4 (patch)
tree828abc765f179b744d9c9a079c155de60f6af64b /test/ruby/test_time.rb
parentdb80be3deb93549eddf058f914fa585445240af6 (diff)
merge revision(s) f4be7a510eebbe6507ba41d138d7d252f4a68e90:
Added tests for Time#getlocal with UTC offset --- test/ruby/test_time.rb | 8 ++++++++ 1 file changed, 8 insertions(+)
Diffstat (limited to 'test/ruby/test_time.rb')
-rw-r--r--test/ruby/test_time.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index 4c24c28c97..3f5cb9d3f2 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -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