aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_iseq.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-28 11:26:23 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-28 11:26:23 +0000
commitb0690af9a4f09fc2cd6d15e7544cc40a4371228d (patch)
treeb61eca2d202a34fe50d48cca0c78e288766311da /test/ruby/test_iseq.rb
parent731acc0950e24262ca657d684ecb6de864ba9b4c (diff)
downloadruby-b0690af9a4f09fc2cd6d15e7544cc40a4371228d.tar.gz
* iseq.c (iseq_data_to_ary): fix condition.
r34303 introduces a bug to avoid all line information from a result of ISeq#to_a. This is a regression problem from 2.0.0p0. * test/ruby/test_iseq.rb: add a test of lines after ISeq#to_a. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_iseq.rb')
-rw-r--r--test/ruby/test_iseq.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index 829b72ffdc..230cea9b91 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -9,6 +9,18 @@ class TestISeq < Test::Unit::TestCase
assert_normal_exit('p RubyVM::InstructionSequence.compile("1", "mac", "", 0).to_a', bug5894)
end
+ def test_to_a_lines
+ src = <<-EOS
+ p __LINE__ # 1
+ p __LINE__ # 2
+ # 3
+ p __LINE__ # 4
+ EOS
+ body = RubyVM::InstructionSequence.new(src).to_a[13]
+ lines = body.find_all{|e| e.kind_of? Fixnum}
+ assert_equal [1, 2, 4], lines
+ end
+
def test_unsupport_type
ary = RubyVM::InstructionSequence.compile("p").to_a
ary[9] = :foobar