aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_iseq.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-12 04:35:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-12 04:35:53 +0000
commit5ac27de1a8b88d286f584796867ece7eaabdce88 (patch)
tree564f539e7db05a2222460e0a7d4723c5eaa725ab /test/ruby/test_iseq.rb
parentce5d2f0c569efc133d504e732a5cc7df071d6790 (diff)
downloadruby-5ac27de1a8b88d286f584796867ece7eaabdce88.tar.gz
iseq.c: preserve encoding
* iseq.c (iseqw_inspect): preserve path encoding in the result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_iseq.rb')
-rw-r--r--test/ruby/test_iseq.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index df71e1821e..54256816cf 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -270,4 +270,12 @@ class TestISeq < Test::Unit::TestCase
assert_equal(0, eval("0"))
end;
end
+
+ def test_inspect
+ %W[foo \u{30d1 30b9}].each do |name|
+ assert_match /@#{name}/, ISeq.compile("", name).inspect, name
+ m = ISeq.compile("class TestISeq::Inspect; def #{name}; end; instance_method(:#{name}); end").eval
+ assert_match /:#{name}@/, ISeq.of(m).inspect, name
+ end
+ end
end