summaryrefslogtreecommitdiff
path: root/test/ruby/test_file.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-28 05:43:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-28 05:43:53 +0000
commit5a53cbe314203ce63630030110c51e7650d0fc0a (patch)
tree6647ac08458df78ac1ebb576c203635879635773 /test/ruby/test_file.rb
parent1daa624d56002b8b0412ccc65de460bec96c23c3 (diff)
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/trunk@62607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_file.rb')
-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 9f09ac6fd1..89757287d1 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)