From aef44205639cc7b114e1cd423443d6a78c271566 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: http://svn.ruby-lang.org/repos/ruby/trunk@4783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/digest/test_digest.rb | 6 +++--- test/ruby/test_iterator.rb | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/digest/test_digest.rb b/test/digest/test_digest.rb index 51865aa96..89f0660fc 100644 --- a/test/digest/test_digest.rb +++ b/test/digest/test_digest.rb @@ -76,16 +76,16 @@ class TestDigest < Test::Unit::TestCase ALGOS.each do |algo| md1 = algo.new("ABC") - assert_equal(md1, md1.clone) + assert_equal(md1, md1.clone, algo) md2 = algo.new md2 << "A" - assert(md1 != md2) + assert(md1 != md2, algo) md2 << "BC" - assert_equal(md1, md2) + assert_equal(md1, md2, algo) end end end 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 -- cgit