Skip to content

Commit

Permalink
Skip test on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jun 3, 2024
1 parent 5599be5 commit 931b792
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/io/event/selector/select.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ def io_read(fiber, io, buffer, length, offset = 0)

Selector.nonblock(io) do
while true
Fiber.blocking{$stderr.puts "buffer.read(#{io}, 0, #{offset})"}
result = Fiber.blocking{buffer.read(io, 0, offset)}
Fiber.blocking{$stderr.puts "buffer.read(#{io}, 0, #{offset}) => #{result}"}

if result < 0
if again?(result)
Expand Down
6 changes: 6 additions & 0 deletions test/io/event/selector/buffered_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
let(:output) {pipe.last}

it "can read using a buffer" do
# Non-blocking pipes are probably not implemented in Ruby's compatibility layer.
# https://learn.microsoft.com/en-gb/windows/win32/api/namedpipeapi/nf-namedpipeapi-setnamedpipehandlestate?redirectedfrom=MSDN
skip "Not supported on Windows" if RUBY_PLATFORM =~ /mswin|mingw|cygwin/

writer = Fiber.new do
buffer = IO::Buffer.new(128)
expect(selector.io_write(Fiber.current, output, buffer, 128)).to be == 128
Expand All @@ -39,6 +43,8 @@
end

it "can read and write at the specified offset" do
skip "Not supported on Windows" if RUBY_PLATFORM =~ /mswin|mingw|cygwin/

writer = Fiber.new do
buffer = IO::Buffer.new(128)
expect(selector.io_write(Fiber.current, output, buffer, 128, 64)).to be == 64
Expand Down

0 comments on commit 931b792

Please sign in to comment.