Bram Moolenaar | 19a1669 | 2016-09-01 22:19:47 +0200 | [diff] [blame] | 1 | |
| 2 | function! Test_WriteFile() |
| 3 | let f = tempname() |
| 4 | call writefile(["over","written"], f, "b") |
| 5 | call writefile(["hello","world"], f, "b") |
| 6 | call writefile(["!", "good"], f, "a") |
| 7 | call writefile(["morning"], f, "ab") |
| 8 | call writefile(["", "vimmers"], f, "ab") |
| 9 | let l = readfile(f) |
| 10 | call assert_equal("hello", l[0]) |
| 11 | call assert_equal("world!", l[1]) |
| 12 | call assert_equal("good", l[2]) |
| 13 | call assert_equal("morning", l[3]) |
| 14 | call assert_equal("vimmers", l[4]) |
| 15 | call delete(f) |
| 16 | endfunction |