mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	 052498ed42
			
		
	
	052498ed42
	
	
	
		
			
			Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
		
			
				
	
	
		
			21 lines
		
	
	
		
			561 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			561 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
| local t = require('test.testutil')
 | |
| local n = require('test.functional.testnvim')()
 | |
| 
 | |
| local clear = n.clear
 | |
| local command = n.command
 | |
| local eq = t.eq
 | |
| local pcall_err = t.pcall_err
 | |
| 
 | |
| describe('gf', function()
 | |
|   before_each(clear)
 | |
| 
 | |
|   it('is not allowed when buffer is locked', function()
 | |
|     command('au OptionSet diff norm! gf')
 | |
|     command([[call setline(1, ['Xfile1', 'line2', 'line3', 'line4'])]])
 | |
|     eq(
 | |
|       'OptionSet Autocommands for "diff": Vim(normal):E788: Not allowed to edit another buffer now',
 | |
|       pcall_err(command, 'diffthis')
 | |
|     )
 | |
|   end)
 | |
| end)
 |