mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: fix file read end-of-file detection (#10070)
This commit is contained in:
@@ -160,8 +160,13 @@ fn test_write_and_read_bytes() {
|
||||
// check that trying to read data from EOF doesn't error and returns 0
|
||||
mut a := []byte{len: 5}
|
||||
nread := file_read.read_bytes_into(5, mut a) or {
|
||||
eprintln(err)
|
||||
int(-1)
|
||||
n := if err is none {
|
||||
int(0)
|
||||
} else {
|
||||
eprintln(err)
|
||||
int(-1)
|
||||
}
|
||||
n
|
||||
}
|
||||
assert nread == 0
|
||||
file_read.close()
|
||||
|
||||
Reference in New Issue
Block a user