aboutsummaryrefslogtreecommitdiff
path: root/test/lua/basic_empty_file.lua
blob: 9cd8cd073f48c98f4669b15af7001a5ccce6d8c0 (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 == 'nl'
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')