mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_m17n.rb: follow to the following changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
439fab8459
commit
120bb4a9d5
2 changed files with 12 additions and 10 deletions
|
@ -1,3 +1,7 @@
|
|||
Thu Jan 24 20:46:17 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_m17n.rb: follow to the following changes.
|
||||
|
||||
Thu Jan 24 20:21:07 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* parser.y (parser_str_new): automatically update string literal's
|
||||
|
|
|
@ -54,7 +54,7 @@ class TestM17N < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def assert_regexp_generic_ascii(r)
|
||||
assert_encoding("ASCII-8BIT", r.encoding)
|
||||
assert_encoding("US-ASCII", r.encoding)
|
||||
assert_regexp_generic_encoding(r)
|
||||
end
|
||||
|
||||
|
@ -137,17 +137,17 @@ class TestM17N < Test::Unit::TestCase
|
|||
# tests start
|
||||
|
||||
def test_string_ascii_literal
|
||||
assert_encoding("ASCII-8BIT", eval(a(%{""})).encoding)
|
||||
assert_encoding("ASCII-8BIT", eval(a(%{"a"})).encoding)
|
||||
assert_encoding("US-ASCII", eval(a(%{""})).encoding)
|
||||
assert_encoding("US-ASCII", eval(a(%{"a"})).encoding)
|
||||
end
|
||||
|
||||
def test_string_eucjp_literal
|
||||
assert_encoding("ASCII-8BIT", eval(e(%{""})).encoding)
|
||||
assert_encoding("ASCII-8BIT", eval(e(%{"a"})).encoding)
|
||||
assert_encoding("US-ASCII", eval(e(%{""})).encoding)
|
||||
assert_encoding("US-ASCII", eval(e(%{"a"})).encoding)
|
||||
assert_encoding("EUC-JP", eval(e(%{"\xa1\xa1"})).encoding)
|
||||
assert_encoding("EUC-JP", eval(e(%{"\\xa1\\xa1"})).encoding)
|
||||
assert_encoding("ASCII-8BIT", eval(e(%{"\\x20"})).encoding)
|
||||
assert_encoding("ASCII-8BIT", eval(e(%{"\\n"})).encoding)
|
||||
assert_encoding("US-ASCII", eval(e(%{"\\x20"})).encoding)
|
||||
assert_encoding("US-ASCII", eval(e(%{"\\n"})).encoding)
|
||||
assert_encoding("EUC-JP", eval(e(%{"\\x80"})).encoding)
|
||||
end
|
||||
|
||||
|
@ -363,8 +363,6 @@ class TestM17N < Test::Unit::TestCase
|
|||
assert_regexp_fixed_ascii8bit(eval(a(%{/\xc2\xa1/n})))
|
||||
assert_regexp_fixed_ascii8bit(eval(a(%q{/\xc2\xa1/})))
|
||||
|
||||
assert_raise(SyntaxError) { eval("/\xa1\xa1/n".force_encoding("euc-jp")) }
|
||||
|
||||
[/\xc2\xa1/n, eval(a(%{/\xc2\xa1/})), eval(a(%{/\xc2\xa1/n}))].each {|r|
|
||||
assert_equal(nil, r =~ a("a"))
|
||||
assert_equal(nil, r =~ e("a"))
|
||||
|
@ -681,7 +679,7 @@ class TestM17N < Test::Unit::TestCase
|
|||
#assert_strenc("\"\xC2\xA1\"", 'Windows-31J', s("%p") % s("\xc2\xa1"))
|
||||
assert_strenc("\"\xC2\xA1\"", 'UTF-8', u("%p") % u("\xc2\xa1"))
|
||||
|
||||
assert_strenc('"\xC2\xA1"', 'ASCII-8BIT', "%10p" % a("\xc2\xa1"))
|
||||
assert_strenc('"\xC2\xA1"', 'US-ASCII', "%10p" % a("\xc2\xa1"))
|
||||
assert_strenc(" \"\xC2\xA1\"", 'EUC-JP', "%10p" % e("\xc2\xa1"))
|
||||
#assert_strenc(" \"\xC2\xA1\"", 'Windows-31J', "%10p" % s("\xc2\xa1"))
|
||||
assert_strenc(" \"\xC2\xA1\"", 'UTF-8', "%10p" % u("\xc2\xa1"))
|
||||
|
|
Loading…
Reference in a new issue