summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_iterator.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-15 23:38:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-15 23:38:10 +0000
commitaef44205639cc7b114e1cd423443d6a78c271566 (patch)
treec73178db42b65dc40319bc4b0bf3db7a8268ff3d /test/ruby/test_iterator.rb
parent6d5b341d389a203c0862d67d5aba75f617615490 (diff)
downloadruby-aef44205639cc7b114e1cd423443d6a78c271566.tar.gz
ruby-aef44205639cc7b114e1cd423443d6a78c271566.tar.xz
ruby-aef44205639cc7b114e1cd423443d6a78c271566.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@4783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_iterator.rb')
-rw-r--r--test/ruby/test_iterator.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb
index 9a5b9c535..f91bf8164 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