robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

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