diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-14 05:04:38 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-14 05:04:38 +0000 |
commit | a5641cdf7a6ef8ed86209080775fa866a360d346 (patch) | |
tree | 0d02fb8f121ebd8547d91909e80315080128b552 | |
parent | 3155da024c265f553cbb0621b67bf29747391035 (diff) | |
download | ruby-a5641cdf7a6ef8ed86209080775fa866a360d346.tar.gz |
added workaround for APFS file format.
* TestFileExhaustive#test_atime: It fails with nano-sec precise.
I changed to use unixtime for this assertion for APFS.
* TestFileExhaustive#test_expand_path: skip assertion when given
invalid charactor on APFS.
[Bug #13816][ruby-core:82383]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_file_exhaustive.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index a3c2a4018a..4c5540eb4c 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -3,6 +3,7 @@ require "test/unit" require "fileutils" require "tmpdir" require "socket" +require '-test-/file' class TestFileExhaustive < Test::Unit::TestCase DRIVE = Dir.pwd[%r'\A(?:[a-z]:|//[^/]+/[^/]+)'i] @@ -572,7 +573,13 @@ class TestFileExhaustive < Test::Unit::TestCase t2 = File.open(file) {|f| f.atime} assert_kind_of(Time, t1) assert_kind_of(Time, t2) - assert_equal(t1, t2) + # High Sierra's APFS can handle nano-sec precise. + # t1 value is difference from t2 on APFS. + if Bug::File::Fs.fsname(Dir.tmpdir) == "apfs" + assert_equal(t1.to_i, t2.to_i) + else + assert_equal(t1, t2) + end end assert_raise(Errno::ENOENT) { File.atime(nofile) } end @@ -749,6 +756,8 @@ class TestFileExhaustive < Test::Unit::TestCase begin open(file) {} rescue + # High Sierra's APFS cannot use filenames with undefined character + next if Bug::File::Fs.fsname(Dir.tmpdir) == "apfs" assert_equal(file, full_path, mesg) else assert_equal(regular_file, full_path, mesg) |