diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-31 14:12:08 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-31 14:12:08 +0000 |
commit | 9f86a43648d77414bc8509f03720a2aed334f62d (patch) | |
tree | aa52afdab275105f14a644b4c7694d1256a346b3 /test | |
parent | 607d93b92e374d4416ba189dd0d73ad51cdb924e (diff) |
merge revision(s) 63512,63514: [Backport #14790]
time.rb: fix parsing time zone in iso8601
* lib/time.rb (Time.xmlschema): a colon in time zone designator
can be omitted. [ruby-core:87277] [Bug #14790]
time.rb: fix parsing time zone in iso8601
* lib/time.rb (Time.xmlschema): the minute in time zone designator
can be omitted together with the preceding colon.
[ruby-core:87277] [Bug #14790]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@64148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/test_time.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/test_time.rb b/test/test_time.rb index 398ab7279b..e33c1f0153 100644 --- a/test/test_time.rb +++ b/test/test_time.rb @@ -105,6 +105,8 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc: t = Time.utc(1996, 12, 20, 0, 39, 57) s = "1996-12-19T16:39:57-08:00" assert_equal(t, Time.__send__(method, s)) + assert_equal(t, Time.__send__(method, s.sub(/:(?=00\z)/, ''))) + assert_equal(t, Time.__send__(method, s.sub(/:00\z/, ''))) # There is no way to generate time string with arbitrary timezone. s = "1996-12-20T00:39:57Z" assert_equal(t, Time.__send__(method, s)) |