aboutsummaryrefslogtreecommitdiff
path: root/lua/basic_empty_file.lua
diff options
context:
space:
mode:
authorJosh Wainwright <josh.wainwright@ldra.com>2016-04-21 10:37:48 +0100
committerJosh Wainwright <josh.wainwright@ldra.com>2016-04-21 10:37:48 +0100
commitf6ff4e24e5003542e59c0a3e5df7a1af8896006a (patch)
treedc643f55430a1ac0f4c8677bec29b43686423270 /lua/basic_empty_file.lua
parent3e47a926e7687d52ac2df06d5b664afd4f644971 (diff)
downloadvis-f6ff4e24e5003542e59c0a3e5df7a1af8896006a.tar.gz
vis-f6ff4e24e5003542e59c0a3e5df7a1af8896006a.tar.xz
Add test for file that does not exist
Diffstat (limited to 'lua/basic_empty_file.lua')
-rw-r--r--lua/basic_empty_file.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/lua/basic_empty_file.lua b/lua/basic_empty_file.lua
new file mode 100644
index 0000000..de1c14e
--- /dev/null
+++ b/lua/basic_empty_file.lua
@@ -0,0 +1,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.status')