diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-05 04:52:24 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-05 04:52:24 +0000 |
commit | 98e5eb6f394562b7bdae830424eda43f6b5f22f7 (patch) | |
tree | ce992fff43fe775cce1ab96c291ad96ada07f5a4 /test/ruby | |
parent | fc47ac274f3627836956904814ddebbce948480e (diff) |
merge revision(s) 47090: [Backport #10114]
* parse.y (parser_yyerror): preserve source code encoding in
syntax error messages. [ruby-core:64228] [Bug #10114]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@47402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_syntax.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 3ccb18d446..bb13a4ed8c 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -352,6 +352,12 @@ eom assert_constant_reassignment_toplevel("11", "+", %w[53], already) end + def test_error_message_encoding + bug10114 = '[ruby-core:64228] [Bug #10114]' + code = "# -*- coding: utf-8 -*-\n" "def n \"\u{2208}\"; end" + assert_syntax_error(code, /def n "\u{2208}"; end/, bug10114) + end + private def not_label(x) @result = x; @not_label ||= nil end |