diff options
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={ |