From 932591003708aac785a1e71ed6beb83e91554320 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 17 Nov 2009 23:41:09 +0000 Subject: [PATCH] * 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 --- test/ruby/test_m17n.rb | 84 +++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index d8a3c09552..1fa6d51288 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -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