mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	 1ee7ca7bc0
			
		
	
	1ee7ca7bc0
	
	
	
		
			
			- Read TEST_TAG/TEST_FILTER env vars from cmake/RunTests.cmake. Setting these environment variables will pass --tags/--filter to busted, which can used to filter which tests are executed. - Remove calls to nvim msgpack-rpc API outside tests. This removes the requirement of having a static `clear` call in test/functional/helpers.lua - Use the new busted command-line option "--lazy" to ensure the setup/teardown hooks are only executed when a suite runs at least one test. Now its possible to run/debug a single test like this: ```sh TEST_FILTER='some test string' make test ``` Which will only run tests containing "some test string" in the title. Another option is: ```sh TEST_TAG=some-tag make test ``` After putting #some-tag into the test title. This also improves debugging experience because there will be no unnecessary gdbserver instances whe GDB=1 is passed.
		
			
				
	
	
		
			25 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
| local helpers = require('test.functional.helpers')
 | |
| local clear, nvim, buffer, curbuf, curwin, eq, neq, ok =
 | |
|   helpers.clear, helpers.nvim, helpers.buffer, helpers.curbuf, helpers.curwin,
 | |
|   helpers.eq, helpers.neq, helpers.ok
 | |
| 
 | |
| describe('TabNew', function()
 | |
|     setup(clear)
 | |
|     describe('au TabNew', function()
 | |
|         describe('with * as <afile>', function()
 | |
|             it('matches when opening any new tab', function()
 | |
|                 nvim('command', 'au! TabNew * echom "tabnew:".tabpagenr().":".bufnr("")')
 | |
|                 eq("\ntabnew:2:1", nvim('command_output', 'tabnew'))
 | |
|                 eq("\ntabnew:3:2\n\"test.x\" [New File]", nvim('command_output', 'tabnew test.x'))
 | |
|             end)
 | |
|         end)
 | |
|         describe('with FILE as <afile>', function()
 | |
|             it('matches when opening a new tab for FILE', function()
 | |
|                 tmp_path = nvim('eval', 'tempname()')
 | |
|                 nvim('command', 'au! TabNew '..tmp_path..' echom "tabnew:match"')
 | |
|                 eq("\ntabnew:4:3\ntabnew:match\n\""..tmp_path.."\" [New File]", nvim('command_output', 'tabnew '..tmp_path))
 | |
|            end)
 | |
|         end)
 | |
|     end)
 | |
| end)
 |