diff options
| author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-04 12:59:09 -0300 | 
|---|---|---|
| committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-04 12:59:09 -0300 | 
| commit | 04633e3e6bb0da1489050fee2c7514f9a1808327 (patch) | |
| tree | ddd4aa89a5f579d054c9627bd2d7cd8a19134767 /test/functional/helpers.lua | |
| parent | 1d250cddb87546c0470462738d546c9d061dff56 (diff) | |
| parent | a695c8786377d2399ca2472df183bdc2d32f4048 (diff) | |
| download | rneovim-04633e3e6bb0da1489050fee2c7514f9a1808327.tar.gz rneovim-04633e3e6bb0da1489050fee2c7514f9a1808327.tar.bz2 rneovim-04633e3e6bb0da1489050fee2c7514f9a1808327.zip | |
Merge PR #1328 'Migrate legacy tests'
Diffstat (limited to 'test/functional/helpers.lua')
| -rw-r--r-- | test/functional/helpers.lua | 24 | 
1 files changed, 23 insertions, 1 deletions
| diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index d9107543ea..70f4fcf9e5 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -67,6 +67,25 @@ local function restart()      mapclear!      abclear      comclear +    let regs = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/-"' +    let i = 0 +    while i < strlen(regs) +      call setreg(regs[i], '') +      let i = i+1 +    endwhile +    redir => funcs +    silent! function +    redir END +    for fname in split(funcs, '\n') +      let matches = matchlist(fname, '\v^function ([^()<>]+)') +      if type([]) == type(matches) && matches[1] !~ 'BeforeEachTest' +        exe 'silent! delfunc '.matches[1] +      endif +    endfor +    let options = ['shell', 'fileignorecase'] +    for option in options +      exe 'set '.option.'&' +    endfor    endfunction    ]])  end @@ -83,6 +102,9 @@ local function request(method, ...)        error(rv[2])      end    end +  -- Make sure this will only return after all buffered characters have been +  -- processed +  session:request('vim_eval', '1')    return rv  end @@ -201,7 +223,6 @@ local function expect(contents, first, last, buffer_index)    return eq(dedent(contents), buffer_slice(first, last, buffer_index))  end -  local function ok(expr)    assert.is_true(expr)  end @@ -254,6 +275,7 @@ restart()  return {    clear = clear, +  dedent = dedent,    restart = restart,    rawfeed = rawfeed,    insert = insert, | 
