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

ruby-changes:12235

From: nobu <ko1@a...>
Date: Wed, 1 Jul 2009 16:10:25 +0900 (JST)
Subject: [ruby-changes:12235] Ruby:r23923 (ruby_1_8): * test/ruby/test_proc.rb (test_return_from_proc): test for .

nobu	2009-07-01 16:09:53 +0900 (Wed, 01 Jul 2009)

  New Revision: 23923

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

  Log:
    * test/ruby/test_proc.rb (test_return_from_proc): test for [ruby-core:24097].

  Modified files:
    branches/ruby_1_8/test/ruby/test_proc.rb

Index: ruby_1_8/test/ruby/test_proc.rb
===================================================================
--- ruby_1_8/test/ruby/test_proc.rb	(revision 23922)
+++ ruby_1_8/test/ruby/test_proc.rb	(revision 23923)
@@ -101,4 +101,11 @@
     c.new.x(nil)
     assert_equal(2, a, '[ruby-core:23050]')
   end
+
+  def given_block(&b) b end
+  def test_return_from_proc
+    a_proc = eval("Proc.new { return }", TOPLEVEL_BINDING)
+    res = given_block(&a_proc)
+    assert_raise(LocalJumpError, '[ruby-core:24097]') {res.call}
+  end
 end

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

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