Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for local jump errors that work now on trunk
git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@4695 961051c9-f516-0410-bf72-c9f7e237a7b7
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'test/unit' | ||
|
||
class TestLocalJumpError < Test::Unit::TestCase | ||
def test_lje_structure | ||
begin | ||
break 1 | ||
rescue LocalJumpError => lje | ||
assert_equal(:break, lje.reason) | ||
assert_equal(1, lje.exit_value) | ||
assert_equal(["@reason", "@exit_value"], lje.instance_variables) | ||
end | ||
|
||
begin | ||
yield 1 | ||
rescue LocalJumpError => lje | ||
assert_equal(:noreason, lje.reason) | ||
assert_equal(nil, lje.exit_value) | ||
end | ||
|
||
=begin This seems like it should work, but it doesn't, even in Ruby... | ||
begin | ||
next | ||
rescue LocalJumpError => lje | ||
assert_equal(:next, lje.reason) | ||
assert_equal(nil, lje.exit_value) | ||
end | ||
=end | ||
end | ||
end |