Skip to content

Commit

Permalink
Add basic test of close interruption.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jan 15, 2025
1 parent aea70d8 commit 4e0b9f6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,18 @@
out.close
end
end

with "#close" do
it "can interrupt reading fiber when closing" do
r, w = IO.pipe

read_task = Async do
r.read(5)
end

r.close

expect{read_task.wait}.to raise_exception(IOError)
end
end
end

0 comments on commit 4e0b9f6

Please sign in to comment.