diff options
author | James McCoy <jamessan@jamessan.com> | 2017-02-22 17:07:47 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-02-22 19:23:20 -0500 |
commit | bc76ce2c4f26a1ceabc8ba7dc8d5ff3378648a40 (patch) | |
tree | b5b295f6a593f77f6995e6d6478afdf37043b11d /test | |
parent | 10c9ecc2117a69d2b83e983082f53c1779547035 (diff) | |
parent | ddab4661f7acad985096138b0c29a2b7e569022a (diff) | |
download | rneovim-bc76ce2c4f26a1ceabc8ba7dc8d5ff3378648a40.tar.gz rneovim-bc76ce2c4f26a1ceabc8ba7dc8d5ff3378648a40.tar.bz2 rneovim-bc76ce2c4f26a1ceabc8ba7dc8d5ff3378648a40.zip |
Merge remote-tracking branch 'origin/master' into lambda
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/cmdline/ctrl_r_spec.lua | 34 | ||||
-rw-r--r-- | test/functional/cmdline/history_spec.lua (renamed from test/functional/ex_getln/history_spec.lua) | 0 | ||||
-rw-r--r-- | test/functional/eval/has_spec.lua | 8 | ||||
-rw-r--r-- | test/functional/eval/let_spec.lua | 22 | ||||
-rw-r--r-- | test/functional/legacy/arglist_spec.lua | 4 |
5 files changed, 67 insertions, 1 deletions
diff --git a/test/functional/cmdline/ctrl_r_spec.lua b/test/functional/cmdline/ctrl_r_spec.lua new file mode 100644 index 0000000000..d2dad23e98 --- /dev/null +++ b/test/functional/cmdline/ctrl_r_spec.lua @@ -0,0 +1,34 @@ +local helpers = require('test.functional.helpers')(after_each) +local clear, insert, funcs, eq, feed = + helpers.clear, helpers.insert, helpers.funcs, helpers.eq, helpers.feed + +describe('cmdline CTRL-R', function() + before_each(clear) + + it('pasting non-special register inserts <CR> *between* lines', function() + insert([[ + line1abc + line2somemoretext + ]]) + -- Yank 2 lines linewise, then paste to cmdline. + feed([[<C-\><C-N>gg0yj:<C-R>0]]) + -- <CR> inserted between lines, NOT after the final line. + eq('line1abc\rline2somemoretext', funcs.getcmdline()) + + -- Yank 2 lines characterwise, then paste to cmdline. + feed([[<C-\><C-N>gg05lyvj:<C-R>0]]) + -- <CR> inserted between lines, NOT after the final line. + eq('abc\rline2', funcs.getcmdline()) + + -- Yank 1 line linewise, then paste to cmdline. + feed([[<C-\><C-N>ggyy:<C-R>0]]) + -- No <CR> inserted. + eq('line1abc', funcs.getcmdline()) + end) + + it('pasting special register inserts <CR>, <NL>', function() + feed([[:<C-R>="foo\nbar\rbaz"<CR>]]) + eq('foo\nbar\rbaz', funcs.getcmdline()) + end) +end) + diff --git a/test/functional/ex_getln/history_spec.lua b/test/functional/cmdline/history_spec.lua index 20f9cf06a2..20f9cf06a2 100644 --- a/test/functional/ex_getln/history_spec.lua +++ b/test/functional/cmdline/history_spec.lua diff --git a/test/functional/eval/has_spec.lua b/test/functional/eval/has_spec.lua index 97b3b0e620..78c4e08fde 100644 --- a/test/functional/eval/has_spec.lua +++ b/test/functional/eval/has_spec.lua @@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each) local eq = helpers.eq local clear = helpers.clear local funcs = helpers.funcs +local iswin = helpers.iswin describe('has()', function() before_each(clear) @@ -49,4 +50,11 @@ describe('has()', function() eq(1, funcs.has("nvim-00.001.05")) end) + it('"unnamedplus"', function() + if (not iswin()) and funcs.has("clipboard") == 1 then + eq(1, funcs.has("unnamedplus")) + else + eq(0, funcs.has("unnamedplus")) + end + end) end) diff --git a/test/functional/eval/let_spec.lua b/test/functional/eval/let_spec.lua new file mode 100644 index 0000000000..c3ab3cc367 --- /dev/null +++ b/test/functional/eval/let_spec.lua @@ -0,0 +1,22 @@ +local helpers = require('test.functional.helpers')(after_each) + +local eq = helpers.eq +local clear = helpers.clear +local meths = helpers.meths +local redir_exec = helpers.redir_exec + +before_each(clear) + +describe(':let command', function() + it('correctly lists variables with curly-braces', function() + meths.set_var('v', {0}) + eq('\nv [0]', redir_exec('let {"v"}')) + end) + + it('correctly lists variables with subscript', function() + meths.set_var('v', {0}) + eq('\nv[0] #0', redir_exec('let v[0]')) + eq('\ng:["v"][0] #0', redir_exec('let g:["v"][0]')) + eq('\n{"g:"}["v"][0] #0', redir_exec('let {"g:"}["v"][0]')) + end) +end) diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua index b86d3f0aea..f5e3522972 100644 --- a/test/functional/legacy/arglist_spec.lua +++ b/test/functional/legacy/arglist_spec.lua @@ -222,7 +222,6 @@ describe('argument list commands', function() execute('argedit a') eq({'a', 'b'}, eval('argv()')) eq('a', eval('expand("%:t")')) - assert_fails('argedit a b', 'E172:') execute('argedit c') eq({'a', 'c', 'b'}, eval('argv()')) execute('0argedit x') @@ -232,6 +231,9 @@ describe('argument list commands', function() execute('argedit! y') eq({'x', 'y', 'a', 'c', 'b'}, eval('argv()')) execute('%argd') + -- Nvim allows unescaped spaces in filename on all platforms. #6010 + execute('argedit a b') + eq({'a b'}, eval('argv()')) end) it('test for :argdelete command', function() |