1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: deprecate write_str and replace it with write_string (#9369)

This commit is contained in:
zakuro
2021-03-21 01:25:51 +09:00
committed by GitHub
parent b7a0c44f39
commit c8416f9a54
13 changed files with 62 additions and 39 deletions

View File

@ -38,7 +38,7 @@ fn test_open_file() {
os.File{}
}
mut file := os.open_file(filename, 'w+', 0o666) or { panic(err) }
file.write_str(hello) or { panic(err) }
file.write_string(hello) or { panic(err) }
file.close()
assert hello.len == os.file_size(filename)
read_hello := os.read_file(filename) or { panic('error reading file $filename') }
@ -87,7 +87,7 @@ fn test_create_file() {
filename := './test1.txt'
hello := 'hello world!'
mut f := os.create(filename) or { panic(err) }
f.write_str(hello) or { panic(err) }
f.write_string(hello) or { panic(err) }
f.close()
assert hello.len == os.file_size(filename)
os.rm(filename) or { panic(err) }