diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-29 08:00:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-29 08:00:34 +0000 |
commit | aa2a845168537c1e495823bfe643924f7f19c28b (patch) | |
tree | 6f49444c0cb1ac4ca6ba8306d553a2f21741a079 /test | |
parent | 1f7839f12cd8dd253e9cc23381128ebbdab053f6 (diff) |
parse.y, vm_eval.c: file encoding in eval
* parse.y (yycompile): store file name as String to keep the encoding.
* parse.y (rb_parser_compile_string_path, rb_parser_compile_file_path):
new functions to pass file name as a String.
* parse.y (gettable_gen): return a copy of the original file name, not
a copy in filesystem encoding.
* vm_eval.c (eval_string_with_cref): use Qundef instead of "(eval)".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_eval.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb index 790e2887d5..edbda38818 100644 --- a/test/ruby/test_eval.rb +++ b/test/ruby/test_eval.rb @@ -468,4 +468,9 @@ class TestEval < Test::Unit::TestCase result = foo.instance_eval(&foo_pr) assert_equal(1, result, 'Bug #3786, Bug #3860, [ruby-core:32501]') end + + def test_file_encoding + fname = "\u{3042}".encode("euc-jp") + assert_equal(fname, eval("__FILE__", nil, fname, 1)) + end end |