diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-10 03:27:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-10 03:27:25 +0200 |
commit | ddd0eb6f5120a09b97867d2561ea61309038ccd2 (patch) | |
tree | 78ba762f7f99840c318f128a73ee6f0e5477968f /test | |
parent | 9daa7d9978ac0249b61e823808cabbcbc997d5c7 (diff) | |
download | rneovim-ddd0eb6f5120a09b97867d2561ea61309038ccd2.tar.gz rneovim-ddd0eb6f5120a09b97867d2561ea61309038ccd2.tar.bz2 rneovim-ddd0eb6f5120a09b97867d2561ea61309038ccd2.zip |
startup: -es/-Es (silent/batch mode): skip swapfile #8540
To use Nvim as a scripting engine the side-effects of swapfiles and user
config should be avoided by default.
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/core/startup_spec.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 8edb8fc014..76e242b1e2 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -203,6 +203,20 @@ describe('startup', function() { 'set encoding', '' })) end) + it('-es/-Es disables swapfile, user config #8540', function() + for _,arg in ipairs({'-es', '-Es'}) do + local out = funcs.system({nvim_prog, arg, + '+set swapfile? updatecount? shada?', + "+put =execute('scriptnames')", '+%print'}) + local line1 = string.match(out, '^.-\n') + -- updatecount=0 means swapfile was disabled. + eq(" swapfile updatecount=0 shada=!,'100,<50,s10,h\n", line1) + -- Standard plugins were loaded, but not user config. + eq('health.vim', string.match(out, 'health.vim')) + eq(nil, string.match(out, 'init.vim')) + end + end) + it('does not crash if --embed is given twice', function() clear{args={'--embed'}} eq(2, eval('1+1')) |