mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 22:14:37 +02:00
preserve encodings in error messages
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7d49923e9e
commit
4191a6b90d
17 changed files with 109 additions and 33 deletions
|
@ -433,6 +433,18 @@ class TestEnumerator < Test::Unit::TestCase
|
|||
assert_raise(RuntimeError) {
|
||||
g.__send__ :initialize, proc { |y| y << 4 << 5 }
|
||||
}
|
||||
|
||||
g = Enumerator::Generator.new(proc {|y| y << 4 << 5; :foo })
|
||||
a = []
|
||||
assert_equal(:foo, g.each {|x| a << x })
|
||||
assert_equal([4, 5], a)
|
||||
|
||||
assert_raise(LocalJumpError) {Enumerator::Generator.new}
|
||||
assert_raise(TypeError) {Enumerator::Generator.new(1)}
|
||||
obj = eval("class C\u{1f5ff}; self; end").new
|
||||
assert_raise_with_message(TypeError, /C\u{1f5ff}/) {
|
||||
Enumerator::Generator.new(obj)
|
||||
}
|
||||
end
|
||||
|
||||
def test_generator_args
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue