gf_spec.lua (561B)
1 local t = require('test.testutil') 2 local n = require('test.functional.testnvim')() 3 4 local clear = n.clear 5 local command = n.command 6 local eq = t.eq 7 local pcall_err = t.pcall_err 8 9 describe('gf', function() 10 before_each(clear) 11 12 it('is not allowed when buffer is locked', function() 13 command('au OptionSet diff norm! gf') 14 command([[call setline(1, ['Xfile1', 'line2', 'line3', 'line4'])]]) 15 eq( 16 'OptionSet Autocommands for "diff": Vim(normal):E788: Not allowed to edit another buffer now', 17 pcall_err(command, 'diffthis') 18 ) 19 end) 20 end)