summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-15 17:19:18 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-02-16 20:34:23 +0900
commit9ef66ce3fcfee06d628b611dbc22026d7cc72d0e (patch)
tree330848440b82ffbd1a3bcda8e120011693c8175f /test
parent4fc6fb2d124b3b122066b82b5d093bf416ab196f (diff)
strftime.c: support unknown offset UTC in RFC 3339 [Feature #17544]
In RFC 3339, -00:00 is used for the time in UTC is known, but the offset to local time is unknown. Support that representation by `-` flag for `z`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4075
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_time.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index b264e7f73c..4e8689bbda 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -920,6 +920,11 @@ class TestTime < Test::Unit::TestCase
assert_equal("+09:00", t.strftime("%:z"))
assert_equal("+09:00:01", t.strftime("%::z"))
assert_equal("+09:00:01", t.strftime("%:::z"))
+
+ assert_equal("+0000", t2000.strftime("%z"))
+ assert_equal("-0000", t2000.strftime("%-z"))
+ assert_equal("-00:00", t2000.strftime("%-:z"))
+ assert_equal("-00:00:00", t2000.strftime("%-::z"))
end
def test_strftime_padding