aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-04 00:07:10 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-13 16:37:59 +0900
commit9441f3f97087a4325ee80911859d37da41fa5050 (patch)
treef2ca3937271ea7871797ec23ea5d62a229237b5d /test
parent30a35420e6afac57db77513d7b6be7cf6a43dbbe (diff)
downloadruby-9441f3f97087a4325ee80911859d37da41fa5050.tar.gz
Allow UTC offset without colons per ISO-8601 [Bug #17504]
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_time.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index e5da0d6343..b264e7f73c 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -1223,6 +1223,12 @@ class TestTime < Test::Unit::TestCase
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]
+ assert_equal [00, 30, 21, 31, 12, 1999], t.getlocal("-0230").to_a[0, 6]
+ assert_equal [00, 00, 9, 1, 1, 2000], t.getlocal("+0900").to_a[0, 6]
+ assert_equal [20, 29, 21, 31, 12, 1999], t.getlocal("-023040").to_a[0, 6]
+ assert_equal [35, 10, 9, 1, 1, 2000], t.getlocal("+091035").to_a[0, 6]
+ assert_raise(ArgumentError) {t.getlocal("-02:3040")}
+ assert_raise(ArgumentError) {t.getlocal("+0910:35")}
end
def test_getlocal_nil