aboutsummaryrefslogtreecommitdiff
path: root/test/lua/basic_empty_file.lua
blob: faa53b0cf0552444169cb2a52ccb30cda80b3b20 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- Tests vis.win.file.* for a file that doesn't exist
local win = vis.win
local results = {}
results[1] = win.file.name == 'basic_empty_file.in'
results[2] = win.file.newlines == 'lf'
results[3] = win.file.size == 0
results[4] = #win.file.lines == 0
results[5] = win.file.lines[0] == ''
results[6] = win.file.syntax or 'true'

delete(win, '%')
for i = 1, #results do
	append(win, i-1, tostring(results[i]))
end
vis:command('w! basic_empty_file.out')