aboutsummaryrefslogtreecommitdiff
path: root/test/functional/options/defaults_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-04-27 17:11:34 +0200
committerGitHub <noreply@github.com>2019-04-27 17:11:34 +0200
commit920ec8181b2bf7547688ed877252a1f2127db198 (patch)
tree7cc6cfd90454d42b7fd9ab1f988608a6db08f371 /test/functional/options/defaults_spec.lua
parente5b53381a27861578498dab3ab9ba7b989677787 (diff)
parent698c4f662d3a30fab1e48dbe7586617a9031a6ea (diff)
downloadrneovim-920ec8181b2bf7547688ed877252a1f2127db198.tar.gz
rneovim-920ec8181b2bf7547688ed877252a1f2127db198.tar.bz2
rneovim-920ec8181b2bf7547688ed877252a1f2127db198.zip
Merge #9915 'test: clear(): args_rm param'
Diffstat (limited to 'test/functional/options/defaults_spec.lua')
-rw-r--r--test/functional/options/defaults_spec.lua39
1 files changed, 29 insertions, 10 deletions
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua
index f6f3f02f45..3d019d3047 100644
--- a/test/functional/options/defaults_spec.lua
+++ b/test/functional/options/defaults_spec.lua
@@ -160,20 +160,39 @@ describe('startup defaults', function()
end)
end)
- describe("'packpath'", function()
- it('defaults to &runtimepath', function()
- eq(meths.get_option('runtimepath'), meths.get_option('packpath'))
- end)
+ it("'shadafile' ('viminfofile')", function()
+ local env = {XDG_DATA_HOME='Xtest-userdata', XDG_CONFIG_HOME='Xtest-userconfig'}
+ clear{args={}, args_rm={'-i'}, env=env}
+ -- Default 'shadafile' is empty.
+ -- This means use the default location. :help shada-file-name
+ eq('', meths.get_option('shadafile'))
+ eq('', meths.get_option('viminfofile'))
+ -- Check that shada data (such as v:oldfiles) is saved/restored.
+ command('edit Xtest-foo')
+ command('write')
+ local f = eval('fnamemodify(@%,":p")')
+ assert(string.len(f) > 3)
+ command('qall')
+ clear{args={}, args_rm={'-i'}, env=env}
+ eq({ f }, eval('v:oldfiles'))
+ os.remove('Xtest-foo')
+ rmdir('Xtest-userdata')
+ end)
- it('does not follow modifications to runtimepath', function()
- meths.command('set runtimepath+=foo')
- neq(meths.get_option('runtimepath'), meths.get_option('packpath'))
- meths.command('set packpath+=foo')
- eq(meths.get_option('runtimepath'), meths.get_option('packpath'))
- end)
+ it("'packpath'", function()
+ clear()
+ -- Defaults to &runtimepath.
+ eq(meths.get_option('runtimepath'), meths.get_option('packpath'))
+
+ -- Does not follow modifications to runtimepath.
+ meths.command('set runtimepath+=foo')
+ neq(meths.get_option('runtimepath'), meths.get_option('packpath'))
+ meths.command('set packpath+=foo')
+ eq(meths.get_option('runtimepath'), meths.get_option('packpath'))
end)
it('v:progpath is set to the absolute path', function()
+ clear()
eq(eval("fnamemodify(v:progpath, ':p')"), eval('v:progpath'))
end)