From e45c4cd1ac8523f83b1d72b068ba009e3d9fe6db Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 15 Oct 2003 23:38:10 +0000 Subject: * test/digest/test_digest.rb (test_eq): show failed class. * test/ruby/test_iterator.rb (test_break, test_return_trace_func): test localjump destination. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_iterator.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb index 9a5b9c5352..f91bf81644 100644 --- a/test/ruby/test_iterator.rb +++ b/test/ruby/test_iterator.rb @@ -403,4 +403,25 @@ class TestIterator < Test::Unit::TestCase end assert(false, "must not reach here") end + + def test_break_from_enum + result = ["a"].inject("ng") {|x,y| break "ok"} + assert_equal("ok", result) + end + + def _test_return_trace_func(x) + set_trace_func(proc {}) + [].fetch(2) {return x} + ensure + set_trace_func(nil) + end + + def test_return_trace_func + ok = "returned gracefully" + result = "skipped" + result = _test_return_from_builtin(ok) + ensure + assert_equal(ok, result) + return + end end -- cgit v1.2.3