Remove Encoding#replicate

This commit is contained in:
Benoit Daloze 2023-01-06 15:07:39 +01:00
parent d831b1d5ce
commit 6abe20e87b
Notes: git 2023-01-11 12:42:09 +00:00
8 changed files with 203 additions and 113 deletions

View 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