mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 06:25:31 +02:00
Add a frozenness check to Enumerator::Generator#initialize.
* enumerator.c (generator_init): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8cb0de91c4
commit
075752a836
2 changed files with 6 additions and 0 deletions
|
@ -419,6 +419,11 @@ class TestEnumerator < Test::Unit::TestCase
|
|||
a = []
|
||||
assert_equal(:foo, g2.each {|x| a << x })
|
||||
assert_equal([1, 2, 3], a)
|
||||
|
||||
g.freeze
|
||||
assert_raise(RuntimeError) {
|
||||
g.__send__ :initialize, proc { |y| y << 4 << 5 }
|
||||
}
|
||||
end
|
||||
|
||||
def test_generator_args
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue