summaryrefslogtreecommitdiff
path: root/test/date
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-16 23:22:13 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-16 23:22:13 +0000
commitcfed2cefb2de1762b50c8345b5048246d7cd7c7f (patch)
treeaaad53671c6201b41ae84342549bcef6256d0981 /test/date
parentdf21038777f9b8339429f4427bf6d25f690b7eb5 (diff)
* lib/date/format.rb (strptime): removed \v; since \s includes \v.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/date')
-rw-r--r--test/date/test_date_parse.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/date/test_date_parse.rb b/test/date/test_date_parse.rb
index 959a6e5d95..c7a9a10ccc 100644
--- a/test/date/test_date_parse.rb
+++ b/test/date/test_date_parse.rb
@@ -639,6 +639,21 @@ class TestDateParse < Test::Unit::TestCase
assert_equal(d, DateTime.parse(d.to_s))
end
+ def test_parse_utf8
+ h = DateTime._parse(
+"Sun\xe3\x80\x80Aug 16 01:02:03 \xe6\x97\xa5\xe6\x9c\xac 2009".
+ force_encoding('utf-8'))
+ assert_equal(2009, h[:year])
+ assert_equal(8, h[:mon])
+ assert_equal(16, h[:mday])
+ assert_equal(0, h[:wday])
+ assert_equal(1, h[:hour])
+ assert_equal(2, h[:min])
+ assert_equal(3, h[:sec])
+ assert_equal("\xe6\x97\xa5\xe6\x9c\xac".
+ force_encoding('utf-8'), h[:zone])
+ end
+
def test_parse__ex
assert_raise(ArgumentError) do
Date.parse('')