[前][次][番号順一覧][スレッド一覧]

ruby-changes:31779

From: ko1 <ko1@a...>
Date: Tue, 26 Nov 2013 20:04:04 +0900 (JST)
Subject: [ruby-changes:31779] ko1:r43858 (trunk): * test/ruby/test_settracefunc.rb: add tests for a_call/a_return

ko1	2013-11-26 20:03:57 +0900 (Tue, 26 Nov 2013)

  New Revision: 43858

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43858

  Log:
    * test/ruby/test_settracefunc.rb: add tests for a_call/a_return
      by Brandur <brandur@m...> [Feature #9120]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_settracefunc.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43857)
+++ ChangeLog	(revision 43858)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Nov 26 20:02:39 2013  Koichi Sasada  <ko1@a...>
+
+	* test/ruby/test_settracefunc.rb: add tests for a_call/a_return
+	  by Brandur <brandur@m...> [Feature #9120]
+
 Tue Nov 26 19:29:52 2013  Koichi Sasada  <ko1@a...>
 
 	* common.mk: add useful config "set breakpoint pending on"
Index: test/ruby/test_settracefunc.rb
===================================================================
--- test/ruby/test_settracefunc.rb	(revision 43857)
+++ test/ruby/test_settracefunc.rb	(revision 43858)
@@ -1024,4 +1024,46 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L1024
     1.times {break}
     END
   end
+
+  def test_a_call
+    events = []
+    TracePoint.new(:a_call){|tp|
+      events << tp.event
+    }.enable{
+      1.times{
+        3
+      }
+      method_for_test_tracepoint_block{
+        4
+      }
+    }
+    assert_equal([
+      :b_call,
+      :c_call,
+      :b_call,
+      :call,
+      :b_call,
+    ], events)
+  end
+
+  def test_a_return
+    events = []
+    TracePoint.new(:a_return){|tp|
+      events << tp.event
+    }.enable{
+      1.times{
+        3
+      }
+      method_for_test_tracepoint_block{
+        4
+      }
+    }
+    assert_equal([
+      :b_return,
+      :c_return,
+      :b_return,
+      :return,
+      :b_return
+    ], events)
+  end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]