ruby-changes:47486
From: naruse <ko1@a...>
Date: Wed, 16 Aug 2017 06:33:59 +0900 (JST)
Subject: [ruby-changes:47486] naruse:r59602 (trunk): High Sierra's APFS cannot use invalid filenames [Bug #13816]
naruse 2017-08-16 06:33:43 +0900 (Wed, 16 Aug 2017) New Revision: 59602 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59602 Log: High Sierra's APFS cannot use invalid filenames [Bug #13816] Modified files: trunk/test/ruby/test_dir_m17n.rb Index: test/ruby/test_dir_m17n.rb =================================================================== --- test/ruby/test_dir_m17n.rb (revision 59601) +++ test/ruby/test_dir_m17n.rb (revision 59602) @@ -1,6 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_dir_m17n.rb#L1 # frozen_string_literal: false require 'test/unit' require 'tmpdir' +require '-test-/file' class TestDir_M17N < Test::Unit::TestCase def with_tmpdir @@ -59,6 +60,8 @@ class TestDir_M17N < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/ruby/test_dir_m17n.rb#L60 def test_filename_extutf8_invalid return if /cygwin/ =~ RUBY_PLATFORM + # High Sierra's APFS cannot use invalid filenames + return if Bug::File::Fs.fsname(Dir.tmpdir) == "apfs" with_tmpdir {|d| assert_separately(%w[-EASCII-8BIT], <<-'EOS', :chdir=>d) filename = "\xff".force_encoding("ASCII-8BIT") # invalid byte sequence as UTF-8 @@ -375,7 +378,12 @@ class TestDir_M17N < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/ruby/test_dir_m17n.rb#L378 a = "file_one*".force_encoding Encoding::IBM437 b = "file_two*".force_encoding Encoding::EUC_JP assert_equal([a, b].map(&:encoding), Dir[a, b].map(&:encoding)) - dir = "\u{76EE 5F551}" + if Bug::File::Fs.fsname(Dir.pwd) == "apfs" + # High Sierra's APFS cannot use filenames with undefined character + dir = "\u{76EE}" + else + dir = "\u{76EE 5F551}" + end Dir.mkdir(dir) list << dir bug12081 = '[ruby-core:73868] [Bug #12081]' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/