summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-11 17:26:02 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-11 17:26:02 +0000
commitfe0fb03316b049783bcf4ecef2d88385eb401a1b (patch)
treed76a40511ce8a7fd552cea166dfa8205359e5000 /test/ruby
parentac521b96b6a9db9089c1a70ba6092c38f8bc009f (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_3@55382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-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 fc1391e60f..7e099401f5 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -1399,6 +1399,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}