mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	tests: terminal: Assert for SIGWINCH handling before continuing
Fixes test failures like
    test/functional/terminal/cursor_spec.lua @ 62: terminal cursor with number column is positioned correctly when focused
    ./test/functional/ui/screen.lua:302: Row 2 did not match.
    Expected:
      |{7:  1 }tty ready                                     |
      |*{7:  2 }{1: }                                             |
      |{7:  3 }                                              |
      |{7:  4 }                                              |
      |{7:  5 }                                              |
      |{7:  6 }                                              |
      |{3:-- TERMINAL --}                                    |
    Actual:
      |{7:  1 }tty ready                                     |
      |*{7:  2 }rows: 6, cols: 46                             |
      |{7:  3 }{1: }                                             |
      |{7:  4 }                                              |
      |{7:  5 }                                              |
      |{7:  6 }                                              |
      |{3:-- TERMINAL --}                                    |
			
			
This commit is contained in:
		| @@ -50,8 +50,8 @@ describe('terminal cursor', function() | |||||||
|     it('is positioned correctly when unfocused', function() |     it('is positioned correctly when unfocused', function() | ||||||
|       screen:expect([[ |       screen:expect([[ | ||||||
|         {7:  1 }tty ready                                     | |         {7:  1 }tty ready                                     | | ||||||
|         {7:  2 }{2:^ }                                             | |         {7:  2 }^rows: 6, cols: 46                             | | ||||||
|         {7:  3 }                                              | |         {7:  3 }{2: }                                             | | ||||||
|         {7:  4 }                                              | |         {7:  4 }                                              | | ||||||
|         {7:  5 }                                              | |         {7:  5 }                                              | | ||||||
|         {7:  6 }                                              | |         {7:  6 }                                              | | ||||||
| @@ -60,12 +60,21 @@ describe('terminal cursor', function() | |||||||
|     end) |     end) | ||||||
|  |  | ||||||
|     it('is positioned correctly when focused', function() |     it('is positioned correctly when focused', function() | ||||||
|  |       screen:expect([[ | ||||||
|  |         {7:  1 }tty ready                                     | | ||||||
|  |         {7:  2 }^rows: 6, cols: 46                             | | ||||||
|  |         {7:  3 }{2: }                                             | | ||||||
|  |         {7:  4 }                                              | | ||||||
|  |         {7:  5 }                                              | | ||||||
|  |         {7:  6 }                                              | | ||||||
|  |         :set number                                       | | ||||||
|  |       ]]) | ||||||
|       feed('i') |       feed('i') | ||||||
|       helpers.wait() |       helpers.wait() | ||||||
|       screen:expect([[ |       screen:expect([[ | ||||||
|         {7:  1 }tty ready                                     | |         {7:  1 }tty ready                                     | | ||||||
|         {7:  2 }{1: }                                             | |         {7:  2 }rows: 6, cols: 46                             | | ||||||
|         {7:  3 }                                              | |         {7:  3 }{1: }                                             | | ||||||
|         {7:  4 }                                              | |         {7:  4 }                                              | | ||||||
|         {7:  5 }                                              | |         {7:  5 }                                              | | ||||||
|         {7:  6 }                                              | |         {7:  6 }                                              | | ||||||
|   | |||||||
| @@ -43,14 +43,23 @@ describe('terminal window', function() | |||||||
|       -- numberwidth=9 |       -- numberwidth=9 | ||||||
|       feed([[<C-\><C-N>]]) |       feed([[<C-\><C-N>]]) | ||||||
|       feed([[:set numberwidth=9 number<CR>i]]) |       feed([[:set numberwidth=9 number<CR>i]]) | ||||||
|  |       screen:expect([[ | ||||||
|  |         {7:       1 }tty ready                                | | ||||||
|  |         {7:       2 }rows: 6, cols: 48                        | | ||||||
|  |         {7:       3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO| | ||||||
|  |         {7:       4 }WXYZrows: 6, cols: 41                    | | ||||||
|  |         {7:       5 }{1: }                                        | | ||||||
|  |         {7:       6 }                                         | | ||||||
|  |         {3:-- TERMINAL --}                                    | | ||||||
|  |       ]]) | ||||||
|       thelpers.feed_data({' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'}) |       thelpers.feed_data({' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'}) | ||||||
|       screen:expect([[ |       screen:expect([[ | ||||||
|         {7:       1 }tty ready                                | |         {7:       1 }tty ready                                | | ||||||
|         {7:       2 }rows: 6, cols: 48                        | |         {7:       2 }rows: 6, cols: 48                        | | ||||||
|         {7:       3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO| |         {7:       3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO| | ||||||
|         {7:       4 }WXYZ abcdefghijklmnopqrstuvwxyzABCDEFGHIJ| |         {7:       4 }WXYZrows: 6, cols: 41                    | | ||||||
|         {7:       5 }KLMNOPQRSTUVWXYZrows: 6, cols: 41        | |         {7:       5 } abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN| | ||||||
|         {7:       6 }{1: }                                        | |         {7:       6 }OPQRSTUVWXYZ{1: }                            | | ||||||
|         {3:-- TERMINAL --}                                    | |         {3:-- TERMINAL --}                                    | | ||||||
|       ]]) |       ]]) | ||||||
|     end) |     end) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 James McCoy
					James McCoy