aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_file.rb')
-rw-r--r--test/ruby/test_file.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index 601d19efcd..c4fed73f48 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -375,6 +375,19 @@ class TestFile < Test::Unit::TestCase
}
end
+ def test_file_share_delete
+ Dir.mktmpdir(__method__.to_s) do |tmpdir|
+ tmp = File.join(tmpdir, 'x')
+ File.open(tmp, mode: IO::WRONLY | IO::CREAT | IO::BINARY | IO::SHARE_DELETE) do |f|
+ assert_file.exist?(tmp)
+ assert_nothing_raised do
+ File.unlink(tmp)
+ end
+ end
+ assert_file.not_exist?(tmp)
+ end
+ end
+
def test_conflicting_encodings
Dir.mktmpdir(__method__.to_s) do |tmpdir|
tmp = File.join(tmpdir, 'x')