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

ruby-changes:63653

From: Nobuyoshi <ko1@a...>
Date: Thu, 19 Nov 2020 15:42:38 +0900 (JST)
Subject: [ruby-changes:63653] 44ad72fa21 (master): Added assertions

https://git.ruby-lang.org/ruby.git/commit/?id=44ad72fa21

From 44ad72fa2113d0e111a1cf76327bcc13de8393e1 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 19 Nov 2020 15:41:38 +0900
Subject: Added assertions


diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index 3ec06b4..78be07d 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -103,13 +103,13 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L103
       f.puts "{ '\u00de' => 'Th', '\u00df' => 'ss', '\u00e0' => 'a' }"
       f.close
 
-      previous_external = Encoding.default_external
-      Encoding.default_external = Encoding::US_ASCII
-      begin
-        load f.path
-        RubyVM::InstructionSequence.compile_file(f.path)
-      ensure
-        Encoding.default_external = previous_external
+      EnvUtil.with_default_external(Encoding::US_ASCII) do
+        assert_warn('') {
+          load f.path
+        }
+        assert_nothing_raised(SyntaxError) {
+          RubyVM::InstructionSequence.compile_file(f.path)
+        }
       end
     end
   end
-- 
cgit v0.10.2


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

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