diff options
Diffstat (limited to 'test/ruby/test_array.rb')
| -rw-r--r-- | test/ruby/test_array.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 49628215b5..6807598054 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1569,6 +1569,15 @@ class TestArray < Test::Unit::TestCase assert_equal(nil, b) end + def test_uniq_bang_with_freeze + ary = [1,2] + orig = ary.dup + assert_raise(RuntimeError, "frozen during comparison") { + ary.uniq! {|v| ary.freeze; 1} + } + assert_equal(orig, ary, "must not be modified once frozen") + end + def test_unshift a = @cls[] assert_equal(@cls['cat'], a.unshift('cat')) |
