1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
let s:suite = themis#suite("Remote plugin command")
let s:expect = themis#helper("expect")
function! s:suite.before_each() abort
1,$delete
call append(0, ["one", "two", "three"])
normal gg
endfunction
function! s:suite.has_nvim() abort
call s:expect(has("nvim")).to_equal(1)
endfunction
function! s:suite.supports_arguments() abort
RPluginCommandNargs0
RPluginCommandNargs1 1
RPluginCommandNargsN
RPluginCommandNargsN 1
RPluginCommandNargsN 1 2
RPluginCommandNargsQ
RPluginCommandNargsQ 1
RPluginCommandNargsP 1
RPluginCommandNargsP 1 2
call s:expect(g:rplugin_command_nargs_0).to_equal(v:true)
call s:expect(g:rplugin_command_nargs_1).to_equal("1")
call s:expect(g:rplugin_command_nargs_n).to_equal(["1", "2"])
call s:expect(g:rplugin_command_nargs_q).to_equal("1")
call s:expect(g:rplugin_command_nargs_p).to_equal(["1", "2"])
endfunction
function! s:suite.supports_line_range() abort
RPluginCommandRange
call s:expect(g:rplugin_command_range).to_equal([1, 1])
1,2RPluginCommandRange
call s:expect(g:rplugin_command_range).to_equal([1, 2])
%RPluginCommandRange
call s:expect(g:rplugin_command_range).to_equal([1, 4])
RPluginCommandRangeP
call s:expect(g:rplugin_command_range_p).to_equal([1, 4])
1,2RPluginCommandRangeP
call s:expect(g:rplugin_command_range_p).to_equal([1, 2])
%RPluginCommandRangeP
call s:expect(g:rplugin_command_range_p).to_equal([1, 4])
RPluginCommandRangeN
call s:expect(g:rplugin_command_range_n).to_equal([1])
2RPluginCommandRangeN
call s:expect(g:rplugin_command_range_n).to_equal([2])
endfunction
function! s:suite.supports_count() abort
RPluginCommandCountN
call s:expect(g:rplugin_command_count_n).to_equal([1])
2RPluginCommandCountN
call s:expect(g:rplugin_command_count_n).to_equal([2])
endfunction
function! s:suite.supports_bang() abort
RPluginCommandBang
call s:expect(g:rplugin_command_bang).to_equal(0)
RPluginCommandBang!
call s:expect(g:rplugin_command_bang).to_equal(1)
endfunction
function! s:suite.supports_register() abort
RPluginCommandRegister a
call s:expect(g:rplugin_command_register).to_equal("a")
endfunction
function! s:suite.supports_completion() abort
RPluginCommandCompletion foo
call s:expect(g:rplugin_command_completion).to_equal(["buffer", "foo"])
endfunction
function! s:suite.supports_eval() abort
let g:to_eval = {'a': 42}
RPluginCommandEval
call s:expect(g:rplugin_command_eval).to_equal({'a': 42, 'b': 43})
endfunction
function! s:suite.supports_asynchronous_commands() abort
RPluginCommandAsync
sleep 50m
call s:expect(g:rplugin_command_async).to_equal(v:true)
endfunction
function! s:suite.supports_recursion() abort
RPluginCommandRecursive 0
call s:expect(g:rplugin_command_recursive).to_equal("10")
endfunction
|