summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 069e5592ca..ec4ff1c15c 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -391,6 +391,24 @@ class TestFileExhaustive < Test::Unit::TestCase
rescue NotImplementedError
end
+ def test_readlink_long_path
+ return unless @symlinkfile
+ bug9157 = '[ruby-core:58592] [Bug #9157]'
+ assert_separately(["-", @symlinkfile, bug9157], <<-"end;")
+ symlinkfile, bug9157 = *ARGV
+ 100.step(1000, 100) do |n|
+ File.unlink(symlinkfile)
+ link = "foo"*n
+ begin
+ File.symlink(link, symlinkfile)
+ rescue Errno::ENAMETOOLONG
+ break
+ end
+ assert_equal(link, File.readlink(symlinkfile), bug9157)
+ end
+ end;
+ end
+
def test_unlink
assert_equal(1, File.unlink(@file))
make_file("foo", @file)