os: enable test_write_and_read_bytes again

pull/6262/head
Delyan Angelov 2020-08-29 07:43:23 +03:00
parent fe8286c53c
commit 718a4692dd
1 changed files with 24 additions and 26 deletions

View File

@ -69,10 +69,9 @@ fn test_write_and_read_string_to_file() {
// test_write_and_read_bytes checks for regressions made in the functions // test_write_and_read_bytes checks for regressions made in the functions
// read_bytes, read_bytes_at and write_bytes. // read_bytes, read_bytes_at and write_bytes.
/*
fn test_write_and_read_bytes() { fn test_write_and_read_bytes() {
file_name := './byte_reader_writer.tst' 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 { mut file_write := os.create(os.real_path(file_name)) or {
eprintln('failed to create file $file_name') 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 // We only need to test read_bytes because this function calls
// read_bytes_at with second parameter zeroed (size, 0). // 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() file_read.close()
// eprintln('rbytes: $rbytes')
assert red_bytes.str() == payload.str() // eprintln('payload: $payload')
assert rbytes == payload
// We finally delete the test file. // We finally delete the test file.
os.rm(file_name) os.rm(file_name)
} }
*/
fn test_create_and_delete_folder() { fn test_create_and_delete_folder() {
folder := './test1' folder := './test1'