diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-02 08:25:51 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-02 08:25:51 +0000 |
commit | 579ffd94da9fa533c8e4fb63a388d8b2957f7b85 (patch) | |
tree | 6efbab518ce34230d52ab4d934cf96124c9b3fa2 /test | |
parent | 607927bf36a17a479b8e740d396b20c135d77ff3 (diff) |
merge revision(s) 62606,62607: [Backport #14557]
file.c: get rid of useless conversion
* file.c (rb_file_s_stat): File.stat does not accept an IO
object as trying conversion to path name string first. skip
conversion to IO and try stat(2) only.
file.c: realpath on special symlink
* file.c (realpath_rec): fallback to symlink path when it is
accessible but the link target is not actual entry on file
systems. [ruby-dev:50487] [Bug #14557]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_file.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index 2aa145a303..ea03b59814 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -303,6 +303,14 @@ class TestFile < Test::Unit::TestCase } end + def test_realpath_special_symlink + IO.pipe do |r, w| + if File.pipe?(path = "/dev/fd/#{r.fileno}") + assert_file.identical?(File.realpath(path), path) + end + end + end + def test_realdirpath Dir.mktmpdir('rubytest-realdirpath') {|tmpdir| realdir = File.realpath(tmpdir) |