mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Isolate the test for Encoding#replicate
It has global side effect which cannot be reverted.
This commit is contained in:
parent
166c4a6a28
commit
921916ff9e
1 changed files with 2 additions and 0 deletions
|
@ -56,11 +56,13 @@ class TestEncoding < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_replicate
|
||||
assert_separately([], "#{<<~'END;'}")
|
||||
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]'
|
||||
assert_raise(TypeError, bug3127) {Encoding::UTF_8.replicate(0)}
|
||||
assert_raise(ArgumentError, bug3127) {Encoding::UTF_8.replicate("\0")}
|
||||
END;
|
||||
end
|
||||
|
||||
def test_dummy_p
|
||||
|
|
Loading…
Reference in a new issue