diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-29 17:59:03 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-29 17:59:03 +0000 |
commit | 2eeb39b3cf1b069f309126daed5cbec67ea3f616 (patch) | |
tree | 16419cfea4aa72c27d7c5455454f644311f57c47 /test | |
parent | 8f52e4912475e838d51dc82ead041d125668ffcf (diff) |
* test/ruby/test_iterator.rb: new test test_break__nested_loop[123].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_iterator.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb index 83bfb25255..d05309adfc 100644 --- a/test/ruby/test_iterator.rb +++ b/test/ruby/test_iterator.rb @@ -359,4 +359,43 @@ class TestIterator < Test::Unit::TestCase def test_iter4 ITER_TEST4.new.foo(44){55} end + + def test_break__nested_loop1 + _test_break__nested_loop1 do + break + end + end + + def _test_break__nested_loop1 + while true + yield + end + assert(false, "must not reach here") + end + + def test_break__nested_loop2 + _test_break__nested_loop2 do + break + end + end + + def _test_break__nested_loop2 + until false + yield + end + assert(false, "must not reach here") + end + + def test_break__nested_loop3 + _test_break__nested_loop3 do + break + end + end + + def _test_break__nested_loop3 + loop do + yield + end + assert(false, "must not reach here") + end end |