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

ruby-changes:52033

From: kazu <ko1@a...>
Date: Thu, 9 Aug 2018 18:36:09 +0900 (JST)
Subject: [ruby-changes:52033] kazu:r64249 (trunk): Fix error when Encoding.default_external is Encoding::IBM437

kazu	2018-08-09 18:36:03 +0900 (Thu, 09 Aug 2018)

  New Revision: 64249

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64249

  Log:
    Fix error when Encoding.default_external is Encoding::IBM437
    
    https://ci.appveyor.com/project/ruby/ruby/build/1.0.9151#L4601
    ```
      1) Error:
    TestArgf#test_inplace_nonascii:
    Encoding::UndefinedConversionError: U+3042 from UTF-8 to IBM437
    ```

  Modified files:
    trunk/test/ruby/test_argf.rb
Index: test/ruby/test_argf.rb
===================================================================
--- test/ruby/test_argf.rb	(revision 64248)
+++ test/ruby/test_argf.rb	(revision 64249)
@@ -258,12 +258,12 @@ class TestArgf < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_argf.rb#L258
   def test_inplace_nonascii
     ext = Encoding.default_external or
       skip "no default external encoding"
-    if ext == Encoding::US_ASCII
-      skip "external encoding is us-ascii"
-    end
     t = nil
-    ["\u{3042}", "\u{e9}"].any? {|n| t = make_tempfile(n.encode(ext))} or
-      skip "no name to test"
+    ["\u{3042}", "\u{e9}"].any? do |n|
+      t = make_tempfile(n.encode(ext))
+    rescue Encoding::UndefinedConversionError
+    end
+    t or skip "no name to test"
     assert_in_out_err(["-i.bak", "-", t.path],
                       "#{<<~"{#"}\n#{<<~'};'}")
     {#

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

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