summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-06 21:04:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-06 21:04:52 +0000
commit2bd1ae1e671822b8222c64c3e0d7241420330537 (patch)
treeef71d122d84394a748723c93068620c213a5c047 /test
parent2b14e2ae05231a675efe7898514b04f8d48b2ec2 (diff)
parse.y: preserve encoding
* 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/trunk@47090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index c20f85feea..1e988ddde7 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -435,6 +435,12 @@ eom
assert_syntax_error("0.0.0", msg)
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