diff options
| author | NARUSE, Yui <naruse@airemix.jp> | 2024-01-30 10:24:31 +0900 |
|---|---|---|
| committer | NARUSE, Yui <naruse@airemix.jp> | 2024-01-30 10:24:31 +0900 |
| commit | 818b4ea9b16e3570b431b86da9a24a5743b29617 (patch) | |
| tree | f87157bb8493fbec37ebd6c38a367dd865168d13 /test/ruby | |
| parent | 634d4e29ef43e2fd113b361c069ffa8984e82362 (diff) | |
merge revision(s) e5a4f757bdf5dc3d8c329ddd268432f9ecc7bff6: [Backport #20086]
Fix Window private file mapping unlink EACCES issue. (#9358)
* Don't return early.
* Add missing `mapping` assignment.
* Make debug logs conditional.
---
io_buffer.c | 18 ++++++++++++------
test/ruby/test_io_buffer.rb | 32 ++++++++++++++------------------
2 files changed, 26 insertions(+), 24 deletions(-)
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_io_buffer.rb | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/test/ruby/test_io_buffer.rb b/test/ruby/test_io_buffer.rb index b4b63b1eda..321b6534ee 100644 --- a/test/ruby/test_io_buffer.rb +++ b/test/ruby/test_io_buffer.rb @@ -521,24 +521,20 @@ class TestIOBuffer < Test::Unit::TestCase def test_private Tempfile.create(%w"buffer .txt") do |file| file.write("Hello World") - file.close - assert_separately(["-W0", "-", file.path], "#{<<-"begin;"}\n#{<<-'end;'}") - begin; - file = File.open(ARGV[0], "r+") - buffer = IO::Buffer.map(file, nil, 0, IO::Buffer::PRIVATE) - begin - assert buffer.private? - refute buffer.readonly? - - buffer.set_string("J") - - # It was not changed because the mapping was private: - file.seek(0) - assert_equal "Hello World", file.read - ensure - buffer&.free - end - end; + + buffer = IO::Buffer.map(file, nil, 0, IO::Buffer::PRIVATE) + begin + assert buffer.private? + refute buffer.readonly? + + buffer.set_string("J") + + # It was not changed because the mapping was private: + file.seek(0) + assert_equal "Hello World", file.read + ensure + buffer&.free + end end end end |
