diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
commit | 9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch) | |
tree | 607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /test/functional/ex_cmds/source_spec.lua | |
parent | 9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff) | |
parent | 3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff) | |
download | rneovim-usermarks.tar.gz rneovim-usermarks.tar.bz2 rneovim-usermarks.zip |
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'test/functional/ex_cmds/source_spec.lua')
-rw-r--r-- | test/functional/ex_cmds/source_spec.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/functional/ex_cmds/source_spec.lua b/test/functional/ex_cmds/source_spec.lua index 163ded43f9..64c3464be7 100644 --- a/test/functional/ex_cmds/source_spec.lua +++ b/test/functional/ex_cmds/source_spec.lua @@ -14,9 +14,9 @@ local eval = helpers.eval local exec_capture = helpers.exec_capture local neq = helpers.neq local matches = helpers.matches -local iswin = helpers.iswin local mkdir = helpers.mkdir local rmdir = helpers.rmdir +local is_os = helpers.is_os describe(':source', function() before_each(function() @@ -44,7 +44,7 @@ describe(':source', function() end) it("changing 'shellslash' changes the result of expand()", function() - if not iswin() then + if not is_os('win') then pending("'shellslash' only works on Windows") return end @@ -104,7 +104,7 @@ describe(':source', function() eq("0zBEEFCAFE", meths.exec('echo d', true)) exec('set cpoptions+=C') - eq('Vim(let):E15: Invalid expression: #{', exc_exec('source')) + eq('Vim(let):E723: Missing end of Dictionary \'}\': ', exc_exec('source')) end) it('selection in current buffer', function() @@ -138,7 +138,7 @@ describe(':source', function() eq('Vim(echo):E117: Unknown function: s:C', exc_exec('echo D()')) exec('set cpoptions+=C') - eq('Vim(let):E15: Invalid expression: #{', exc_exec("'<,'>source")) + eq('Vim(let):E723: Missing end of Dictionary \'}\': ', exc_exec("'<,'>source")) end) it('does not break if current buffer is modified while sourced', function() @@ -166,6 +166,7 @@ describe(':source', function() vim.g.sourced_lua = 1 vim.g.sfile_value = vim.fn.expand('<sfile>') vim.g.stack_value = vim.fn.expand('<stack>') + vim.g.script_value = vim.fn.expand('<script>') ]]) command('set shellslash') @@ -173,6 +174,7 @@ describe(':source', function() eq(1, eval('g:sourced_lua')) matches([[/test%.lua$]], meths.get_var('sfile_value')) matches([[/test%.lua$]], meths.get_var('stack_value')) + matches([[/test%.lua$]], meths.get_var('script_value')) os.remove(test_file) end) @@ -214,6 +216,7 @@ describe(':source', function() "\ 2]=] vim.g.sfile_value = vim.fn.expand('<sfile>') vim.g.stack_value = vim.fn.expand('<stack>') + vim.g.script_value = vim.fn.expand('<script>') ]]) command('edit '..test_file) @@ -223,6 +226,7 @@ describe(':source', function() eq(' \\ 1\n "\\ 2', exec_lua('return _G.a')) eq(':source (no file)', meths.get_var('sfile_value')) eq(':source (no file)', meths.get_var('stack_value')) + eq(':source (no file)', meths.get_var('script_value')) os.remove(test_file) end) |