summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-23 12:03:58 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-23 12:03:58 +0000
commitf40c637794ebd9f20c56f51e3aa5c10130421754 (patch)
treeee54fdb7e73aed8280a5d32064c4c94b17d8ca85 /test
parent29fa5cc869d6435a84e3f5467e89fbb8f4b5462c (diff)
merge revision(s) 62607: [Backport #14557]
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_4@62903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index 58a4240391..d0d6a0ebe2 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -284,6 +284,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)