summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-10 08:30:09 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-10 08:30:09 +0000
commit5287eb7453f481dd1fed7b8561cd0b57771afaa9 (patch)
tree76ecc0a55f55da548afb2941432cf1ccf8613e1c /test
parentca75e7b97e4618681a8c27807dce44ae6724039e (diff)
merge revision(s) 54893: [Backport #10763]
* parse.y (new_if_gen): set newline flag to NODE_IF to trace all if/elsif statements. [ruby-core:67720] [Bug #10763] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@55360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_settracefunc.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index b09ed17ce8..277593516d 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -1401,6 +1401,25 @@ class TestSetTraceFunc < Test::Unit::TestCase
assert_equal [__LINE__ - 3, __LINE__ - 2], lines, 'Bug #10449'
end
+ def test_elsif_line_event
+ bug10763 = '[ruby-core:67720] [Bug #10763]'
+ lines = []
+ line = nil
+
+ TracePoint.new(:line){|tp|
+ next unless target_thread?
+ lines << tp.lineno if line
+ }.enable{
+ line = __LINE__
+ if !line
+ 1
+ elsif line
+ 2
+ end
+ }
+ assert_equal [line+1, line+3, line+4], lines, bug10763
+ end
+
class Bug10724
def initialize
loop{return}