mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test for non-ascii method name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
23f0e341af
commit
d0e6130031
1 changed files with 15 additions and 0 deletions
|
@ -1858,4 +1858,19 @@ class TestM17N < Test::Unit::TestCase
|
||||||
def test_regexp_match
|
def test_regexp_match
|
||||||
assert_equal([0,0], //.match("\xa1\xa1".force_encoding("euc-jp"),-1).offset(0))
|
assert_equal([0,0], //.match("\xa1\xa1".force_encoding("euc-jp"),-1).offset(0))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_nonascii_method_name
|
||||||
|
eval(e("def \xc2\xa1() @nonascii_method_name = :e end"))
|
||||||
|
eval(u("def \xc2\xa1() @nonascii_method_name = :u end"))
|
||||||
|
eval(e("\xc2\xa1()"))
|
||||||
|
assert_equal(:e, @nonascii_method_name)
|
||||||
|
eval(u("\xc2\xa1()"))
|
||||||
|
assert_equal(:u, @nonascii_method_name)
|
||||||
|
me = method(e("\xc2\xa1"))
|
||||||
|
mu = method(u("\xc2\xa1"))
|
||||||
|
assert_not_equal(me.name, mu.name)
|
||||||
|
assert_not_equal(me.inspect, mu.inspect)
|
||||||
|
assert_equal(e("\xc2\xa1"), me.name)
|
||||||
|
assert_equal(u("\xc2\xa1"), mu.name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue