neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

wundo_spec.lua (871B)


      1 -- Specs for :wundo and underlying functions
      2 
      3 local n = require('test.functional.testnvim')()
      4 
      5 local command = n.command
      6 local clear = n.clear
      7 local eval = n.eval
      8 local set_session = n.set_session
      9 
     10 describe(':wundo', function()
     11  before_each(clear)
     12  after_each(function()
     13    os.remove(eval('getcwd()') .. '/foo')
     14  end)
     15 
     16  it('safely fails on new, non-empty buffer', function()
     17    command('normal! iabc')
     18    command('wundo foo') -- This should not segfault. #1027
     19    --TODO: check messages for error message
     20  end)
     21 end)
     22 
     23 describe('u_* functions', function()
     24  it('safely fail on new, non-empty buffer', function()
     25    local session = n.new_session(false, {
     26      args = {
     27        '-c',
     28        'set undodir=. undofile',
     29      },
     30    })
     31    set_session(session)
     32    command('echo "True"') -- Should not error out due to crashed Neovim
     33    session:close()
     34  end)
     35 end)