mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	test: Add extra screen expectation to prevent race condition
This is to ensure ctrl+c is only pressed after the command has started executing in the viml_system_spec.lua system() interrupt test.
This commit is contained in:
		@@ -79,6 +79,22 @@ describe('system()', function()
 | 
			
		||||
 | 
			
		||||
    it('`yes` and is interrupted with CTRL-C', function()
 | 
			
		||||
      feed(':call system("yes")<cr>')
 | 
			
		||||
      screen:expect([[
 | 
			
		||||
                                                             |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ^call system("yes")                                  |
 | 
			
		||||
      ]])
 | 
			
		||||
      feed('<c-c>')
 | 
			
		||||
      screen:expect([[
 | 
			
		||||
        ^                                                    |
 | 
			
		||||
@@ -227,8 +243,24 @@ describe('systemlist()', function()
 | 
			
		||||
      ]])
 | 
			
		||||
    end)
 | 
			
		||||
 | 
			
		||||
    it('`yes` and is a little bit later interrupted with CTRL-C', function()
 | 
			
		||||
    it('`yes` and is interrupted with CTRL-C', function()
 | 
			
		||||
      feed(':call systemlist("yes | xargs")<cr>')
 | 
			
		||||
      screen:expect([[
 | 
			
		||||
                                                             |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ~                                                    |
 | 
			
		||||
        ^call systemlist("yes | xargs")                      |
 | 
			
		||||
      ]])
 | 
			
		||||
      feed('<c-c>')
 | 
			
		||||
      screen:expect([[
 | 
			
		||||
        ^                                                    |
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user