From 6b24178534c6c321134246d864c1bdde55800fa5 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 14 Nov 2016 18:15:22 +0000 Subject: merge revision(s) 56559,56582,56584,56585: [Backport #12903] * test/ruby/test_file.rb (TestFile#test_stat): fix noatime case. [ruby-core:77943] [Bug #12903] * ext/-test/file/fs.c (get_atime_p): Updating of file access times is enabled or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_file.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index f5a00f9e17..a4ddf1d74d 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -2,6 +2,7 @@ require 'test/unit' require 'tempfile' require "thread" +require "-test-/file" require_relative 'ut_eof' class TestFile < Test::Unit::TestCase @@ -358,6 +359,7 @@ class TestFile < Test::Unit::TestCase sleep 2 File.write(path, "bar") sleep 2 + File.read(path) File.chmod(0644, path) sleep 2 File.read(path) @@ -369,7 +371,7 @@ class TestFile < Test::Unit::TestCase if stat.birthtime != stat.ctime assert_in_delta t0+4, stat.ctime.to_f, delta end - unless /mswin|mingw/ =~ RUBY_PLATFORM + if /mswin|mingw/ !~ RUBY_PLATFORM && !Bug::File::Fs.noatime?(path) # Windows delays updating atime assert_in_delta t0+6, stat.atime.to_f, delta end -- cgit v1.2.3