1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_m17n.rb: get rid of empty string interpolations

confusing ruby-mode.el.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-11-17 23:41:09 +00:00
parent 8d84e28c0e
commit 9325910037

View file

@ -646,40 +646,40 @@ class TestM17N < Test::Unit::TestCase
def test_dynamic_ascii_regexp
assert_warning(%r{regexp match /.../n against to}) {
assert_regexp_generic_ascii(/#{}/n)
assert_regexp_generic_ascii(/#{ }/n)
}
assert_regexp_fixed_ascii8bit(/#{}\xc2\xa1/n)
assert_regexp_fixed_ascii8bit(/\xc2\xa1#{}/n)
assert_regexp_fixed_ascii8bit(/#{ }\xc2\xa1/n)
assert_regexp_fixed_ascii8bit(/\xc2\xa1#{ }/n)
assert_nothing_raised { s1, s2 = a('\xc2'), a('\xa1'); /#{s1}#{s2}/ }
end
def test_dynamic_eucjp_regexp
assert_regexp_fixed_eucjp(/#{}/e)
assert_regexp_fixed_eucjp(/#{}\xc2\xa1/e)
assert_regexp_fixed_eucjp(/\xc2\xa1#{}/e)
assert_raise(SyntaxError) { eval('/\xc2#{}/e') }
assert_raise(SyntaxError) { eval('/#{}\xc2/e') }
assert_raise(SyntaxError) { eval('/\xc2#{}\xa1/e') }
assert_regexp_fixed_eucjp(/#{ }/e)
assert_regexp_fixed_eucjp(/#{ }\xc2\xa1/e)
assert_regexp_fixed_eucjp(/\xc2\xa1#{ }/e)
assert_raise(SyntaxError) { eval('/\xc2#{ }/e') }
assert_raise(SyntaxError) { eval('/#{ }\xc2/e') }
assert_raise(SyntaxError) { eval('/\xc2#{ }\xa1/e') }
assert_raise(ArgumentError) { s1, s2 = e('\xc2'), e('\xa1'); /#{s1}#{s2}/ }
end
def test_dynamic_sjis_regexp
assert_regexp_fixed_sjis(/#{}/s)
assert_regexp_fixed_sjis(/#{}\xc2\xa1/s)
assert_regexp_fixed_sjis(/\xc2\xa1#{}/s)
assert_raise(SyntaxError) { eval('/\x81#{}/s') }
assert_raise(SyntaxError) { eval('/#{}\x81/s') }
assert_raise(SyntaxError) { eval('/\x81#{}\xa1/s') }
assert_regexp_fixed_sjis(/#{ }/s)
assert_regexp_fixed_sjis(/#{ }\xc2\xa1/s)
assert_regexp_fixed_sjis(/\xc2\xa1#{ }/s)
assert_raise(SyntaxError) { eval('/\x81#{ }/s') }
assert_raise(SyntaxError) { eval('/#{ }\x81/s') }
assert_raise(SyntaxError) { eval('/\x81#{ }\xa1/s') }
assert_raise(ArgumentError) { s1, s2 = s('\x81'), s('\xa1'); /#{s1}#{s2}/ }
end
def test_dynamic_utf8_regexp
assert_regexp_fixed_utf8(/#{}/u)
assert_regexp_fixed_utf8(/#{}\xc2\xa1/u)
assert_regexp_fixed_utf8(/\xc2\xa1#{}/u)
assert_raise(SyntaxError) { eval('/\xc2#{}/u') }
assert_raise(SyntaxError) { eval('/#{}\xc2/u') }
assert_raise(SyntaxError) { eval('/\xc2#{}\xa1/u') }
assert_regexp_fixed_utf8(/#{ }/u)
assert_regexp_fixed_utf8(/#{ }\xc2\xa1/u)
assert_regexp_fixed_utf8(/\xc2\xa1#{ }/u)
assert_raise(SyntaxError) { eval('/\xc2#{ }/u') }
assert_raise(SyntaxError) { eval('/#{ }\xc2/u') }
assert_raise(SyntaxError) { eval('/\xc2#{ }\xa1/u') }
assert_raise(ArgumentError) { s1, s2 = u('\xc2'), u('\xa1'); /#{s1}#{s2}/ }
end
@ -712,23 +712,23 @@ class TestM17N < Test::Unit::TestCase
assert_raise(SyntaxError) { eval(s(%{/\\u{6666}\\xc2\\xa1/})) }
assert_nothing_raised { eval(u(%{/\\u{6666}\\xc2\\xa1/})) }
assert_raise(SyntaxError) { eval(a(%{/\xc2\xa1#{}\\u{6666}/})) }
assert_raise(SyntaxError) { eval(e(%{/\xc2\xa1#{}\\u{6666}/})) }
assert_raise(SyntaxError) { eval(s(%{/\xc2\xa1#{}\\u{6666}/})) }
assert_nothing_raised { eval(u(%{/\xc2\xa1#{}\\u{6666}/})) }
assert_raise(SyntaxError) { eval(a(%{/\\u{6666}#{}\xc2\xa1/})) }
assert_raise(SyntaxError) { eval(e(%{/\\u{6666}#{}\xc2\xa1/})) }
assert_raise(SyntaxError) { eval(s(%{/\\u{6666}#{}\xc2\xa1/})) }
assert_nothing_raised { eval(u(%{/\\u{6666}#{}\xc2\xa1/})) }
assert_raise(SyntaxError) { eval(a(%{/\xc2\xa1#{ }\\u{6666}/})) }
assert_raise(SyntaxError) { eval(e(%{/\xc2\xa1#{ }\\u{6666}/})) }
assert_raise(SyntaxError) { eval(s(%{/\xc2\xa1#{ }\\u{6666}/})) }
assert_nothing_raised { eval(u(%{/\xc2\xa1#{ }\\u{6666}/})) }
assert_raise(SyntaxError) { eval(a(%{/\\u{6666}#{ }\xc2\xa1/})) }
assert_raise(SyntaxError) { eval(e(%{/\\u{6666}#{ }\xc2\xa1/})) }
assert_raise(SyntaxError) { eval(s(%{/\\u{6666}#{ }\xc2\xa1/})) }
assert_nothing_raised { eval(u(%{/\\u{6666}#{ }\xc2\xa1/})) }
assert_raise(SyntaxError) { eval(a(%{/\\xc2\\xa1#{}\\u{6666}/})) }
assert_raise(SyntaxError) { eval(e(%{/\\xc2\\xa1#{}\\u{6666}/})) }
assert_raise(SyntaxError) { eval(s(%{/\\xc2\\xa1#{}\\u{6666}/})) }
assert_nothing_raised { eval(u(%{/\\xc2\\xa1#{}\\u{6666}/})) }
assert_raise(SyntaxError) { eval(a(%{/\\u{6666}#{}\\xc2\\xa1/})) }
assert_raise(SyntaxError) { eval(e(%{/\\u{6666}#{}\\xc2\\xa1/})) }
assert_raise(SyntaxError) { eval(s(%{/\\u{6666}#{}\\xc2\\xa1/})) }
assert_nothing_raised { eval(u(%{/\\u{6666}#{}\\xc2\\xa1/})) }
assert_raise(SyntaxError) { eval(a(%{/\\xc2\\xa1#{ }\\u{6666}/})) }
assert_raise(SyntaxError) { eval(e(%{/\\xc2\\xa1#{ }\\u{6666}/})) }
assert_raise(SyntaxError) { eval(s(%{/\\xc2\\xa1#{ }\\u{6666}/})) }
assert_nothing_raised { eval(u(%{/\\xc2\\xa1#{ }\\u{6666}/})) }
assert_raise(SyntaxError) { eval(a(%{/\\u{6666}#{ }\\xc2\\xa1/})) }
assert_raise(SyntaxError) { eval(e(%{/\\u{6666}#{ }\\xc2\\xa1/})) }
assert_raise(SyntaxError) { eval(s(%{/\\u{6666}#{ }\\xc2\\xa1/})) }
assert_nothing_raised { eval(u(%{/\\u{6666}#{ }\\xc2\\xa1/})) }
end
def test_str_allocate
@ -1218,30 +1218,30 @@ class TestM17N < Test::Unit::TestCase
def test_regexp_usascii
assert_regexp_usascii_literal('//', Encoding::US_ASCII)
assert_regexp_usascii_literal('/#{}/', Encoding::US_ASCII)
assert_regexp_usascii_literal('/#{ }/', Encoding::US_ASCII)
assert_regexp_usascii_literal('/#{"a"}/', Encoding::US_ASCII)
assert_regexp_usascii_literal('/#{%q"\x80"}/', Encoding::ASCII_8BIT)
assert_regexp_usascii_literal('/#{"\x80"}/', nil, SyntaxError)
assert_regexp_usascii_literal('/a/', Encoding::US_ASCII)
assert_regexp_usascii_literal('/a#{}/', Encoding::US_ASCII)
assert_regexp_usascii_literal('/a#{ }/', Encoding::US_ASCII)
assert_regexp_usascii_literal('/a#{"a"}/', Encoding::US_ASCII)
assert_regexp_usascii_literal('/a#{%q"\x80"}/', Encoding::ASCII_8BIT)
assert_regexp_usascii_literal('/a#{"\x80"}/', nil, SyntaxError)
assert_regexp_usascii_literal('/\x80/', Encoding::ASCII_8BIT)
assert_regexp_usascii_literal('/\x80#{}/', Encoding::ASCII_8BIT)
assert_regexp_usascii_literal('/\x80#{ }/', Encoding::ASCII_8BIT)
assert_regexp_usascii_literal('/\x80#{"a"}/', Encoding::ASCII_8BIT)
assert_regexp_usascii_literal('/\x80#{%q"\x80"}/', Encoding::ASCII_8BIT)
assert_regexp_usascii_literal('/\x80#{"\x80"}/', nil, SyntaxError)
assert_regexp_usascii_literal('/\u1234/', Encoding::UTF_8)
assert_regexp_usascii_literal('/\u1234#{}/', Encoding::UTF_8)
assert_regexp_usascii_literal('/\u1234#{ }/', Encoding::UTF_8)
assert_regexp_usascii_literal('/\u1234#{"a"}/', Encoding::UTF_8)
assert_regexp_usascii_literal('/\u1234#{%q"\x80"}/', nil, SyntaxError)
assert_regexp_usascii_literal('/\u1234#{"\x80"}/', nil, SyntaxError)
assert_regexp_usascii_literal('/\u1234\x80/', nil, SyntaxError)
assert_regexp_usascii_literal('/\u1234#{}\x80/', nil, RegexpError)
assert_regexp_usascii_literal('/\u1234#{ }\x80/', nil, RegexpError)
end
def test_gbk