From 06953dceed879bba1b2c31ae3a994cb872402cd4 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 2 Mar 2004 02:28:44 +0000 Subject: [PATCH] * test/ruby/test_iterator.rb (test_ljump): cannot use assert_nothing_raised due to passing block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++-- test/ruby/test_iterator.rb | 15 +++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca65248c82ca1b..504891d63219e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Mar 2 11:28:40 2004 Nobuyoshi Nakada + + * test/ruby/test_iterator.rb (test_ljump): cannot use + assert_nothing_raised due to passing block. + Tue Mar 2 06:23:14 2004 David Black * Fixed Kernel#scanf to propagate code block @@ -5,7 +10,7 @@ Tue Mar 2 06:23:14 2004 David Black Mon Mar 1 23:25:40 2004 David Black * lib/scanf.rb: Partial fix so STDIN#scanf works with new - STDIN#pos behavior + STDIN#pos behavior Mon Mar 1 19:42:05 Hirokazu Yamamoto @@ -20,7 +25,7 @@ Mon Mar 1 12:24:10 2004 Dave Thomas Sun Feb 29 23:14:53 2004 Dave Thomas - * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_class): + * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_class): Handle :nodoc: on singleton classes. Sat Feb 28 21:50:20 Hirokazu Yamamoto diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb index f3c2201e0a867b..38e795ee72430a 100644 --- a/test/ruby/test_iterator.rb +++ b/test/ruby/test_iterator.rb @@ -298,12 +298,19 @@ def test_proc_return2 end def test_ljump - block = get_block{11} - lambda = lambda{44} assert_raises(LocalJumpError) {get_block{break}.call} - assert_nothing_raised {lambda{break}.call} - assert_instance_of(LocalJumpError, (get_block{break}.call rescue $!)) + # cannot use assert_nothing_raised due to passing block. + begin + val = lambda{break 11}.call + rescue LocalJumpError + assert(false, "LocalJumpError occurred from break in lambda") + else + assert(11, val) + end + + block = get_block{11} + lambda = lambda{44} assert_equal(-1, block.arity) assert_equal(-1, lambda.arity) assert_equal(0, lambda{||}.arity)