aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-03 05:19:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-03 05:19:20 +0000
commitaafa14b4e8e0340b5bc1ab6bcbd76f5e5435e15f (patch)
tree9588fe56764eb9bbeccedc3d29bcc8c153f8d2b5 /test
parent82a39294184dbcad35ea5ba08fb7ccb5689c9360 (diff)
downloadruby-aafa14b4e8e0340b5bc1ab6bcbd76f5e5435e15f.tar.gz
parse.y: trace elsif
* 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/trunk@54893 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 9de2137aab..018c0062c3 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}