mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: enable test_write_and_read_bytes again
This commit is contained in:
parent
fe8286c53c
commit
718a4692dd
@ -69,10 +69,9 @@ fn test_write_and_read_string_to_file() {
|
||||
|
||||
// test_write_and_read_bytes checks for regressions made in the functions
|
||||
// read_bytes, read_bytes_at and write_bytes.
|
||||
/*
|
||||
fn test_write_and_read_bytes() {
|
||||
file_name := './byte_reader_writer.tst'
|
||||
payload := [`I`, `D`, `D`, `Q`, `D`]
|
||||
payload := [byte(`I`), `D`, `D`, `Q`, `D`]
|
||||
|
||||
mut file_write := os.create(os.real_path(file_name)) or {
|
||||
eprintln('failed to create file $file_name')
|
||||
@ -94,17 +93,16 @@ fn test_write_and_read_bytes() {
|
||||
|
||||
// We only need to test read_bytes because this function calls
|
||||
// read_bytes_at with second parameter zeroed (size, 0).
|
||||
red_bytes := file_read.read_bytes(5)
|
||||
rbytes := file_read.read_bytes(5)
|
||||
|
||||
file_read.close()
|
||||
|
||||
assert red_bytes.str() == payload.str()
|
||||
// eprintln('rbytes: $rbytes')
|
||||
// eprintln('payload: $payload')
|
||||
assert rbytes == payload
|
||||
|
||||
// We finally delete the test file.
|
||||
os.rm(file_name)
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
fn test_create_and_delete_folder() {
|
||||
folder := './test1'
|
||||
|
Loading…
Reference in New Issue
Block a user