diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-02 02:28:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-02 02:28:44 +0000 |
commit | 06953dceed879bba1b2c31ae3a994cb872402cd4 (patch) | |
tree | 81833788dd9172951ca97f33573043b4e1013739 | |
parent | 4bea8f3ce2b0542334ac38a8ef83e94cd1049b03 (diff) | |
download | ruby-06953dceed879bba1b2c31ae3a994cb872402cd4.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | test/ruby/test_iterator.rb | 15 |
2 files changed, 18 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Tue Mar 2 11:28:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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 <dblack@wobblini.net> * Fixed Kernel#scanf to propagate code block @@ -5,7 +10,7 @@ Tue Mar 2 06:23:14 2004 David Black <dblack@wobblini.net> Mon Mar 1 23:25:40 2004 David Black <dblack@wobblini.net> * 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 <ocean@m2.ccsnet.ne.jp> @@ -20,7 +25,7 @@ Mon Mar 1 12:24:10 2004 Dave Thomas <dave@pragprog.com> Sun Feb 29 23:14:53 2004 Dave Thomas <dave@pragprog.com> - * 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 <ocean@m2.ccsnet.ne.jp> diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb index f3c2201e0a..38e795ee72 100644 --- a/test/ruby/test_iterator.rb +++ b/test/ruby/test_iterator.rb @@ -298,12 +298,19 @@ class TestIterator < Test::Unit::TestCase 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) |