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

os: move file methods to vlib/os/file.c.v, document them, add new file.read_struct and file.write_struct and tests

This commit is contained in:
Delyan Angelov
2021-03-04 13:33:54 +02:00
parent 6097045b46
commit 5e0e44eb69
4 changed files with 269 additions and 143 deletions

View File

@ -20,7 +20,7 @@ fn read_file(file string, cap int) []string {
}
fn test_file_reader() {
for cap := 64; cap <= 10000; cap += 256 {
for cap := 1; cap <= 10000; cap += 256 {
lines := read_file(@FILE, cap)
assert lines.last() == '// my last line'
}