mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
Remove Encoding#replicate
This commit is contained in:
parent
d831b1d5ce
commit
6abe20e87b
Notes:
git
2023-01-11 12:42:09 +00:00
8 changed files with 203 additions and 113 deletions
15
test/-ext-/string/test_too_many_dummy_encodings.rb
Normal file
15
test/-ext-/string/test_too_many_dummy_encodings.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
# frozen_string_literal: false
|
||||
require 'test/unit'
|
||||
require "-test-/string"
|
||||
|
||||
class Test_TooManyDummyEncodings < Test::Unit::TestCase
|
||||
def test_exceed_encoding_table_size
|
||||
assert_separately(%w[--disable=gems], "#{<<~"begin;"}\n#{<<~'end;'}")
|
||||
begin;
|
||||
require "-test-/string"
|
||||
assert_raise_with_message(EncodingError, /too many encoding/) do
|
||||
1_000.times{|i| Bug::String.rb_define_dummy_encoding("R_#{i}") } # now 256 entries
|
||||
end
|
||||
end;
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue