tests: unit.helpers: provide string with write errors (#10715)

This might help to have more information in case of errors, like
mentioned in https://github.com/neovim/neovim/commit/eec529cf9e.
This commit is contained in:
Daniel Hahler
2019-08-06 17:42:32 +02:00
committed by GitHub
parent 067a39ba85
commit e85b4e749e

View File

@@ -456,8 +456,8 @@ else
if bytes_written == -1 then
local err = ffi.errno(0)
if err ~= ffi.C.kPOSIXErrnoEINTR then
assert(false, ("write() error: %u: %s"):format(
err, ffi.string(ffi.C.strerror(err))))
assert(false, ("write() error: %u: %s ('%s')"):format(
err, ffi.string(ffi.C.strerror(err)), s))
end
elseif bytes_written == 0 then
break