aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-06-15 21:39:34 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-06-15 21:42:55 +0900
commitd09f097eec4fb85cbb43481bdc6d7fcc82f94697 (patch)
tree3a9ab2e3d89c16c715671f90827aa80a63ab9f81
parentb32e6c168a3463c1eda7a94f7716adbd3d607a38 (diff)
downloadruby-d09f097eec4fb85cbb43481bdc6d7fcc82f94697.tar.gz
Time#getlocal tests for [Feature #17544]
-rw-r--r--test/ruby/test_time.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index 5d2c7b71de..99f2e8048d 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -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]