Skip to content

Commit

Permalink
fixup! MFile#read should not raise IO::EOFError
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed Jan 1, 2025
1 parent fa56a58 commit 6275d57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/mfile_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ describe MFile do
file.flush
begin
MFile.open(file.path) do |mfile|
buf = Bytes.new(128)
buf = Bytes.new(6)
cnt = mfile.read(buf)
String.new(buf[0, cnt]).should eq "hello world"
String.new(buf[0, cnt]).should eq "hello "
cnt = mfile.read(buf)
String.new(buf[0, cnt]).should eq "world"
end
ensure
file.delete
Expand Down

0 comments on commit 6275d57

Please sign in to comment.