зеркало из https://github.com/github/ruby.git
* ksvndifftest/date/test_date_parse.rb: use UTF-8 literals.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
bf5ae9cfdd
Коммит
fab47c96c5
|
@ -640,9 +640,7 @@ class TestDateParse < Test::Unit::TestCase
|
|||
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'))
|
||||
h = DateTime._parse("Sun\u{3000}Aug 16 01:02:03 \u{65e5}\u{672c} 2009")
|
||||
assert_equal(2009, h[:year])
|
||||
assert_equal(8, h[:mon])
|
||||
assert_equal(16, h[:mday])
|
||||
|
@ -650,8 +648,7 @@ class TestDateParse < Test::Unit::TestCase
|
|||
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])
|
||||
assert_equal("\u{65e5}\u{672c}", h[:zone])
|
||||
end
|
||||
|
||||
def test_parse__ex
|
||||
|
|
Загрузка…
Ссылка в новой задаче