mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 11:33:58 +02:00
parent
f641179525
commit
14bcf69c9c
5 changed files with 80 additions and 62 deletions
|
@ -57,6 +57,7 @@ class TestEncoding < Test::Unit::TestCase
|
|||
|
||||
def test_replicate
|
||||
assert_separately([], "#{<<~'END;'}")
|
||||
Warning[:deprecated] = false
|
||||
assert_instance_of(Encoding, Encoding::UTF_8.replicate("UTF-8-ANOTHER#{Time.now.to_f}"))
|
||||
assert_instance_of(Encoding, Encoding::ISO_2022_JP.replicate("ISO-2022-JP-ANOTHER#{Time.now.to_f}"))
|
||||
bug3127 = '[ruby-dev:40954]'
|
||||
|
@ -69,7 +70,7 @@ class TestEncoding < Test::Unit::TestCase
|
|||
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
|
||||
begin;
|
||||
200.times {|i|
|
||||
Encoding::UTF_8.replicate("dummy#{i}")
|
||||
EnvUtil.suppress_warning { Encoding::UTF_8.replicate("dummy#{i}") }
|
||||
}
|
||||
e = Encoding.list.last
|
||||
format = "%d".force_encoding(e)
|
||||
|
@ -82,7 +83,7 @@ class TestEncoding < Test::Unit::TestCase
|
|||
|
||||
name = "A" * 64
|
||||
Encoding.list.each do |enc|
|
||||
assert_raise(ArgumentError) {enc.replicate(name)}
|
||||
assert_raise(ArgumentError) { EnvUtil.suppress_warning { enc.replicate(name) } }
|
||||
name.succ!
|
||||
end
|
||||
end;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue