ruby-changes:66491
From: Nobuyoshi <ko1@a...>
Date: Tue, 15 Jun 2021 21:47:04 +0900 (JST)
Subject: [ruby-changes:66491] d09f097eec (master): Time#getlocal tests for [Feature #17544]
https://git.ruby-lang.org/ruby.git/commit/?id=d09f097eec From d09f097eec4fb85cbb43481bdc6d7fcc82f94697 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 15 Jun 2021 21:39:34 +0900 Subject: Time#getlocal tests for [Feature #17544] --- test/ruby/test_time.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 5d2c7b7..99f2e80 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -1228,6 +1228,16 @@ class TestTime < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_time.rb#L1228 } 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] -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/