diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-15 23:44:10 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-04-28 00:27:07 +0200 |
commit | 769f44e918c61023a3a01dc238a881049f4c6649 (patch) | |
tree | 04d069ba4db9cb18f20585235838331486d661f9 /test/functional/options/defaults_spec.lua | |
parent | 83d571653bdc100d8fe56b4241f29a1aa996c705 (diff) | |
download | rneovim-769f44e918c61023a3a01dc238a881049f4c6649.tar.gz rneovim-769f44e918c61023a3a01dc238a881049f4c6649.tar.bz2 rneovim-769f44e918c61023a3a01dc238a881049f4c6649.zip |
win/defaults: Use "…/nvim-data/site" in 'runtimepath'
On Windows we store non-config data in "$XDG_DATA_HOME/nvim-data". But
the "…/site" items in 'runtimepath' did not correctly point to that
location, they used "…/nvim/site".
Fix the init logic to use "…/nvim-data/site".
closes #9910
Diffstat (limited to 'test/functional/options/defaults_spec.lua')
-rw-r--r-- | test/functional/options/defaults_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index 3d019d3047..0fc2876d00 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -1,4 +1,5 @@ local helpers = require('test.functional.helpers')(after_each) +local global_helpers = require('test.helpers') local Screen = require('test.functional.ui.screen') @@ -15,6 +16,7 @@ local neq = helpers.neq local mkdir = helpers.mkdir local rmdir = helpers.rmdir local alter_slashes = helpers.alter_slashes +local table_contains = global_helpers.table_contains describe('startup defaults', function() describe(':filetype', function() @@ -250,6 +252,23 @@ describe('XDG-based defaults', function() -- Need separate describe() blocks to not run clear() twice. -- Do not put before_each() here for the same reasons. + it("&runtimepath data-dir matches stdpath('data') #9910", function() + clear() + local rtp = eval('split(&runtimepath, ",")') + local rv = {} + local expected = (iswin() + and { [[\nvim-data\site]], [[\nvim-data\site\after]], } + or { '/nvim/site', '/nvim/site/after', }) + + for _,v in ipairs(rtp) do + local m = string.match(v, [=[[/\]nvim[^/\]*[/\]site.*$]=]) + if m and not table_contains(rv, m) then + table.insert(rv, m) + end + end + eq(expected, rv) + end) + describe('with empty/broken environment', function() it('sets correct defaults', function() clear({env={ |