From 9f773625e5ae2d9b38ec5ccd6ecc6435fc891439 Mon Sep 17 00:00:00 2001 From: tadf Date: Sun, 28 Oct 2012 10:16:02 +0000 Subject: =?UTF-8?q?=09*=20ext/date/date=5Fparse.c=20(iso8601=5F{ext,bas}?= =?UTF-8?q?=5Ftime):=20should=20not=20match=20=09=20=20empty=20string.=20-?= =?UTF-8?q?=20=E3=81=93=E3=81=AE=E8=A1=8C=E4=BB=A5=E4=B8=8B=E3=81=AF?= =?UTF-8?q?=E7=84=A1=E8=A6=96=E3=81=95=E3=82=8C=E3=81=BE=E3=81=99=20--?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit M ChangeLog M ext/date/date_parse.c M test/date/test_date_parse.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/date/test_date_parse.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/date/test_date_parse.rb b/test/date/test_date_parse.rb index f2cfb6f8e6..953eec163c 100644 --- a/test/date/test_date_parse.rb +++ b/test/date/test_date_parse.rb @@ -541,6 +541,9 @@ class TestDateParse < Test::Unit::TestCase assert_equal([2006, 333], h.values_at(:year, :yday)) h = Date._parse('333') assert_equal([nil, 333], h.values_at(:year, :yday)) + + h = Date._parse('') + assert_equal({}, h) end def test_parse @@ -822,6 +825,8 @@ class TestDateParse < Test::Unit::TestCase assert_equal([nil, nil, nil, 4, 5, 6, 3600], h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + h = Date._iso8601('') + assert_equal({}, h) end def test__rfc3339 @@ -834,6 +839,9 @@ class TestDateParse < Test::Unit::TestCase h = Date._rfc3339('2001-02-03T04:05:06.07+01:00') assert_equal([2001, 2, 3, 4, 5, 6, 3600], h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + + h = Date._rfc3339('') + assert_equal({}, h) end def test__xmlschema @@ -913,6 +921,9 @@ class TestDateParse < Test::Unit::TestCase h = Date._xmlschema('-92001-02-03T04:05:06.07+01:00') assert_equal([-92001, 2, 3, 4, 5, 6, 3600], h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + + h = Date._xmlschema('') + assert_equal({}, h) end def test__rfc2822 @@ -942,6 +953,9 @@ class TestDateParse < Test::Unit::TestCase h1 = Date._rfc2822('Sat, 3 Feb 2001 04:05:06 UT') h2 = Date._rfc822('Sat, 3 Feb 2001 04:05:06 UT') assert_equal(h1, h2) + + h = Date._rfc2822('') + assert_equal({}, h) end def test__httpdate @@ -959,6 +973,9 @@ class TestDateParse < Test::Unit::TestCase h = Date._httpdate('Sat Feb 03 04:05:06 2001') assert_equal([2001, 2, 3, 4, 5, 6, nil], h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + + h = Date._httpdate('') + assert_equal({}, h) end def test__jisx0301 @@ -984,6 +1001,9 @@ class TestDateParse < Test::Unit::TestCase h = Date._jisx0301('H13.02.03T04:05:06.07+0100') assert_equal([2001, 2, 3, 4, 5, 6, 3600], h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)) + + h = Date._jisx0301('') + assert_equal({}, h) end def test_iso8601 -- cgit v1.2.3