[macruby-changes] [4786] MacRuby/trunk/test_vm/caller.rb

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 11 17:54:53 PDT 2010


Revision: 4786
          http://trac.macosforge.org/projects/ruby/changeset/4786
Author:   lsansonetti at apple.com
Date:     2010-10-11 17:54:52 -0700 (Mon, 11 Oct 2010)
Log Message:
-----------
start collecting #caller tests

Added Paths:
-----------
    MacRuby/trunk/test_vm/caller.rb

Added: MacRuby/trunk/test_vm/caller.rb
===================================================================
--- MacRuby/trunk/test_vm/caller.rb	                        (rev 0)
+++ MacRuby/trunk/test_vm/caller.rb	2010-10-12 00:54:52 UTC (rev 4786)
@@ -0,0 +1,37 @@
+assert "6", %{
+def f
+  self.inspect
+  puts caller.join('').scan(/(\\d+):/)
+end
+f
+}
+
+assert "7\n12", %{
+class A
+  def f
+    puts caller.join('').scan(/(\\d+):/)
+  end
+  def g
+    f
+    self.inspect
+  end
+end
+a = A.new
+a.g
+}
+
+assert "10\n14", %{
+class A            # line 1
+  def f
+    caller.join('').scan(/(\\d+):/)
+  end
+  def g
+    1
+    self.inspect
+    2
+    f
+  end
+end
+a = A.new
+puts a.g
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101011/6388162e/attachment-0001.html>


More information about the macruby-changes mailing list