diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2022-06-30 13:16:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 04:16:46 -0700 |
commit | f50135a32e11c535e1dc3a8e9460c5b4e640ee86 (patch) | |
tree | 4531a75f5f099877cb8d672743abf03004171f4f /test/functional/options/defaults_spec.lua | |
parent | 514e76e4b2903530922529c60bfbf32cadd257a3 (diff) | |
download | rneovim-f50135a32e11c535e1dc3a8e9460c5b4e640ee86.tar.gz rneovim-f50135a32e11c535e1dc3a8e9460c5b4e640ee86.tar.bz2 rneovim-f50135a32e11c535e1dc3a8e9460c5b4e640ee86.zip |
feat: stdpath('run'), /tmp/nvim.user/ #18993
Problem:
- Since c57f6b28d71d #8519, sockets are created in ~/.local/… but XDG
spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which
implies that XDG_STATE_DIR is potentially non-local.
- Not easy to inspect Nvim-created temp files (for debugging etc).
Solution:
- Store sockets in stdpath('run') ($XDG_RUNTIME_DIR).
- Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims.
- Make ok() actually useful.
- Introduce assert_nolog().
closes #3517
closes #17093
Diffstat (limited to 'test/functional/options/defaults_spec.lua')
-rw-r--r-- | test/functional/options/defaults_spec.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index 92873e9937..9244ca0974 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -9,6 +9,7 @@ local clear = helpers.clear local exc_exec = helpers.exc_exec local eval = helpers.eval local eq = helpers.eq +local ok = helpers.ok local funcs = helpers.funcs local insert = helpers.insert local iswin = helpers.iswin @@ -238,7 +239,7 @@ describe('startup defaults', function() end) end) -describe('XDG-based defaults', function() +describe('XDG defaults', function() -- Need separate describe() blocks to not run clear() twice. -- Do not put before_each() here for the same reasons. @@ -282,6 +283,7 @@ describe('XDG-based defaults', function() eq('.', meths.get_option('viewdir')) eq('.', meths.get_option('directory')) eq('.', meths.get_option('undodir')) + ok((funcs.tempname()):len() > 4) end) end) @@ -306,6 +308,7 @@ describe('XDG-based defaults', function() .. env_sep.. root_path .. ('/b'):rep(2048) .. (env_sep .. root_path .. '/c'):rep(512)), XDG_DATA_HOME=(root_path .. ('/X'):rep(4096)), + XDG_RUNTIME_DIR=(root_path .. ('/X'):rep(4096)), XDG_STATE_HOME=(root_path .. ('/X'):rep(4096)), XDG_DATA_DIRS=(root_path .. ('/A'):rep(2048) .. env_sep .. root_path .. ('/B'):rep(2048) @@ -376,6 +379,7 @@ describe('XDG-based defaults', function() XDG_CONFIG_HOME='$XDG_DATA_HOME', XDG_CONFIG_DIRS='$XDG_DATA_DIRS', XDG_DATA_HOME='$XDG_CONFIG_HOME', + XDG_RUNTIME_DIR='$XDG_RUNTIME_DIR', XDG_STATE_HOME='$XDG_CONFIG_HOME', XDG_DATA_DIRS='$XDG_CONFIG_DIRS', }}) @@ -438,6 +442,7 @@ describe('XDG-based defaults', function() meths.get_option('undodir'):gsub('\\', '/')) eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/view//'), meths.get_option('viewdir'):gsub('\\', '/')) + eq(nil, (funcs.tempname()):match('XDG_RUNTIME_DIR')) end) end) @@ -519,6 +524,7 @@ describe('stdpath()', function() eq(statedir, funcs.fnamemodify(funcs.stdpath('state'), ':t')) eq('table', type(funcs.stdpath('config_dirs'))) eq('table', type(funcs.stdpath('data_dirs'))) + eq('string', type(funcs.stdpath('run'))) assert_alive() -- Check for crash. #8393 end) |