summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-01 20:07:58 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-01 20:07:58 +0000
commit5bdd03936c2a7fb5c835587535466ec76bf0ca9e (patch)
tree6aa8af24b76d2155bbac0e47808c7833890ffcff /test
parent921385a6443338d6150e71acf0806108294c1c9a (diff)
downloadruby-5bdd03936c2a7fb5c835587535466ec76bf0ca9e.tar.gz
* iseq.c (rb_iseq_line_trace_each): iterate `line' event only.
* test/ruby/test_iseq.rb: add a test for this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 b31fcb70dd..7d46004802 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -26,6 +26,15 @@ class TestISeq < Test::Unit::TestCase
Encoding.default_internal = enc
end
+ LINE_BEFORE_METHOD = __LINE__
+ def method_test_line_trace
+
+ a = 1
+
+ b = 2
+
+ end
+
def test_line_trace
iseq = ISeq.compile \
%q{ a = 1
@@ -48,6 +57,9 @@ class TestISeq < Test::Unit::TestCase
iseq.eval
}
assert_equal([2, 5], result)
+
+ iseq = ISeq.of(self.class.instance_method(:method_test_line_trace))
+ assert_equal([LINE_BEFORE_METHOD + 3, LINE_BEFORE_METHOD + 5], iseq.line_trace_all)
end
LINE_OF_HERE = __LINE__