aboutsummaryrefslogtreecommitdiff
path: root/test/functional/options/defaults_spec.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-01-13 14:20:21 -0800
committerGitHub <noreply@github.com>2021-01-13 23:20:21 +0100
commitea8756f85ddd0aeed2e7eccd0ea86ade4fb7eca8 (patch)
tree1db34b1738a52f520ea7dd618916729e040a0b9a /test/functional/options/defaults_spec.lua
parent77a6049e07d070470d3274348ac61ab9b96cac6f (diff)
downloadrneovim-ea8756f85ddd0aeed2e7eccd0ea86ade4fb7eca8.tar.gz
rneovim-ea8756f85ddd0aeed2e7eccd0ea86ade4fb7eca8.tar.bz2
rneovim-ea8756f85ddd0aeed2e7eccd0ea86ade4fb7eca8.zip
logging: move to XDG_CACHE_HOME (#13739)
while there is some controversy, stdpath('cache') looks like a better fit for logs than stdpath('data'): you can remove logs without preventing nvim to work which fits the XDG_CACHE_HOME definition of `user specific non-essential data files`.
Diffstat (limited to 'test/functional/options/defaults_spec.lua')
-rw-r--r--test/functional/options/defaults_spec.lua23
1 files changed, 11 insertions, 12 deletions
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua
index 92d077ed14..12a31b592d 100644
--- a/test/functional/options/defaults_spec.lua
+++ b/test/functional/options/defaults_spec.lua
@@ -204,9 +204,8 @@ describe('startup defaults', function()
end)
describe('$NVIM_LOG_FILE', function()
- local datasubdir = iswin() and 'nvim-data' or 'nvim'
local xdgdir = 'Xtest-startup-xdg-logpath'
- local xdgdatadir = xdgdir..'/'..datasubdir
+ local xdgcachedir = xdgdir..'/nvim'
after_each(function()
os.remove('Xtest-logpath')
rmdir(xdgdir)
@@ -218,25 +217,25 @@ describe('startup defaults', function()
}})
eq('Xtest-logpath', eval('$NVIM_LOG_FILE'))
end)
- it('defaults to stdpath("data")/log if empty', function()
- eq(true, mkdir(xdgdir) and mkdir(xdgdatadir))
+ it('defaults to stdpath("cache")/log if empty', function()
+ eq(true, mkdir(xdgdir) and mkdir(xdgcachedir))
clear({env={
- XDG_DATA_HOME=xdgdir,
+ XDG_CACHE_HOME=xdgdir,
NVIM_LOG_FILE='', -- Empty is invalid.
}})
- eq(xdgdir..'/'..datasubdir..'/log', string.gsub(eval('$NVIM_LOG_FILE'), '\\', '/'))
+ eq(xdgcachedir..'/log', string.gsub(eval('$NVIM_LOG_FILE'), '\\', '/'))
end)
- it('defaults to stdpath("data")/log if invalid', function()
- eq(true, mkdir(xdgdir) and mkdir(xdgdatadir))
+ it('defaults to stdpath("cache")/log if invalid', function()
+ eq(true, mkdir(xdgdir) and mkdir(xdgcachedir))
clear({env={
- XDG_DATA_HOME=xdgdir,
+ XDG_CACHE_HOME=xdgdir,
NVIM_LOG_FILE='.', -- Any directory is invalid.
}})
- eq(xdgdir..'/'..datasubdir..'/log', string.gsub(eval('$NVIM_LOG_FILE'), '\\', '/'))
+ eq(xdgcachedir..'/log', string.gsub(eval('$NVIM_LOG_FILE'), '\\', '/'))
end)
- it('defaults to .nvimlog if stdpath("data") is invalid', function()
+ it('defaults to .nvimlog if stdpath("cache") is invalid', function()
clear({env={
- XDG_DATA_HOME='Xtest-missing-xdg-dir',
+ XDG_CACHE_HOME='Xtest-missing-xdg-dir',
NVIM_LOG_FILE='.', -- Any directory is invalid.
}})
eq('.nvimlog', eval('$NVIM_LOG_FILE'))