[前][次][番号順一覧][スレッド一覧]

ruby-changes:60011

From: Nobuyoshi <ko1@a...>
Date: Wed, 12 Feb 2020 14:54:27 +0900 (JST)
Subject: [ruby-changes:60011] 921916ff9e (master): Isolate the test for Encoding#replicate

https://git.ruby-lang.org/ruby.git/commit/?id=921916ff9e

From 921916ff9e2940f28d932af84c5b2a2e222219d0 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 11 Feb 2020 13:09:56 +0900
Subject: Isolate the test for Encoding#replicate

It has global side effect which cannot be reverted.

diff --git a/test/ruby/test_encoding.rb b/test/ruby/test_encoding.rb
index 024d21b..282ac6b 100644
--- a/test/ruby/test_encoding.rb
+++ b/test/ruby/test_encoding.rb
@@ -56,11 +56,13 @@ class TestEncoding < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_encoding.rb#L56
   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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]