Skip to content

Commit

Permalink
Test for local jump errors that work now on trunk
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@4695 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information
headius committed Oct 23, 2007
1 parent eb42fdc commit 9bc942e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/jruby_index
Expand Up @@ -30,6 +30,7 @@ test_io
test_nkf
test_java_accessible_object
test_java_extension
test_local_jump_error
test_method_missing
test_methods
#test_openssl
Expand Down
29 changes: 29 additions & 0 deletions test/test_local_jump_error.rb
@@ -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

0 comments on commit 9bc942e

Please sign in to comment.