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

ci: fix some of v test-cleancode 1

This commit is contained in:
Delyan Angelov
2021-04-05 20:47:32 +03:00
parent 4822274d29
commit fec89c7efb
7 changed files with 18 additions and 12 deletions

View File

@ -66,7 +66,8 @@ fn test_write_struct() ? {
f.write_struct(another_point) ?
f.close()
x := os.read_file(tfile) ?
y := unsafe { byteptr(memdup(&another_point, size_of_point)).vstring_with_len(size_of_point) }
pcopy := unsafe { &byte(memdup(&another_point, size_of_point)) }
y := unsafe { pcopy.vstring_with_len(size_of_point) }
assert x == y
$if debug {
eprintln(x.bytes())
@ -120,7 +121,8 @@ fn test_write_raw() ? {
f.write_raw(another_point) ?
f.close()
x := os.read_file(tfile) ?
y := unsafe { byteptr(memdup(&another_point, size_of_point)).vstring_with_len(size_of_point) }
pcopy := unsafe { &byte(memdup(&another_point, size_of_point)) }
y := unsafe { pcopy.vstring_with_len(size_of_point) }
assert x == y
$if debug {
eprintln(x.bytes())