summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-21 14:57:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-21 14:57:55 +0000
commit274e50c1892eaa24c2287146a43360a576a6a465 (patch)
treea658f9833ebea8761ce4eaeae535367a79a67374 /test
parent3f939a449d01b1ac578230a8884144d51cd7637f (diff)
encoding.c: preserve outer errinfo
* encoding.c (load_encoding): should preserve outer errinfo, so that expected exception may not be lost. [ruby-core:57949] [Bug #9038] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_encoding.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_encoding.rb b/test/ruby/test_encoding.rb
index c1ded6c741..0a5a9ce197 100644
--- a/test/ruby/test_encoding.rb
+++ b/test/ruby/test_encoding.rb
@@ -108,4 +108,13 @@ class TestEncoding < Test::Unit::TestCase
asc = "b".force_encoding(Encoding::US_ASCII)
assert_equal(Encoding::ASCII_8BIT, Encoding.compatible?(bin, asc))
end
+
+ def test_errinfo_after_autoload
+ bug9038 = '[ruby-core:57949] [Bug #9038]'
+ assert_separately(%w[--disable=gems], <<-"end;")
+ assert_raise_with_message(SyntaxError, /unknown regexp option - Q/, #{bug9038.dump}) {
+ eval("/regexp/sQ")
+ }
+ end;
+ end
end