diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2019-03-24 12:55:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-24 12:55:41 +0100 |
| commit | f705ed22fd9ae8a0477779f822bd99dfb010ea4b (patch) | |
| tree | d29d3bd48a02fc62f4516a2d0b65484c54efc28f /src/nvim/testdir/test_python3.vim | |
| parent | 0920c6ca812d673628cf6d04d68af50cddccbd3e (diff) | |
| parent | a73e0e8e773003eff41795cd6dac2c1213e2eaf8 (diff) | |
| download | rneovim-f705ed22fd9ae8a0477779f822bd99dfb010ea4b.tar.gz rneovim-f705ed22fd9ae8a0477779f822bd99dfb010ea4b.tar.bz2 rneovim-f705ed22fd9ae8a0477779f822bd99dfb010ea4b.zip | |
Merge #9776 from janlazo/vim-8.1.0177
Diffstat (limited to 'src/nvim/testdir/test_python3.vim')
| -rw-r--r-- | src/nvim/testdir/test_python3.vim | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_python3.vim b/src/nvim/testdir/test_python3.vim index 2e3fc93674..d5b1cb1b34 100644 --- a/src/nvim/testdir/test_python3.vim +++ b/src/nvim/testdir/test_python3.vim @@ -52,3 +52,87 @@ func Test_vim_function() py3 del f delfunc s:foo endfunc + +func _SetUpHiddenBuffer() + py3 import vim + new + edit hidden + setlocal bufhidden=hide + + enew + let lnum = 0 + while lnum < 10 + call append( 1, string( lnum ) ) + let lnum = lnum + 1 + endwhile + normal G + + call assert_equal( line( '.' ), 11 ) +endfunc + +func Test_Write_To_HiddenBuffer_Does_Not_Fix_Cursor_Clear() + call _SetUpHiddenBuffer() + py3 vim.buffers[ int( vim.eval( 'bufnr("hidden")' ) ) ][:] = None + call assert_equal( line( '.' ), 11 ) + bwipe! +endfunc + +func Test_Write_To_HiddenBuffer_Does_Not_Fix_Cursor_List() + call _SetUpHiddenBuffer() + py3 vim.buffers[ int( vim.eval( 'bufnr("hidden")' ) ) ][:] = [ 'test' ] + call assert_equal( line( '.' ), 11 ) + bwipe! +endfunc + +func Test_Write_To_HiddenBuffer_Does_Not_Fix_Cursor_Str() + call _SetUpHiddenBuffer() + py3 vim.buffers[ int( vim.eval( 'bufnr("hidden")' ) ) ][0] = 'test' + call assert_equal( line( '.' ), 11 ) + bwipe! +endfunc + +func Test_Write_To_HiddenBuffer_Does_Not_Fix_Cursor_ClearLine() + call _SetUpHiddenBuffer() + py3 vim.buffers[ int( vim.eval( 'bufnr("hidden")' ) ) ][0] = None + call assert_equal( line( '.' ), 11 ) + bwipe! +endfunc + +func _SetUpVisibleBuffer() + py3 import vim + new + let lnum = 0 + while lnum < 10 + call append( 1, string( lnum ) ) + let lnum = lnum + 1 + endwhile + normal G + call assert_equal( line( '.' ), 11 ) +endfunc + +func Test_Write_To_Current_Buffer_Fixes_Cursor_Clear() + call _SetUpVisibleBuffer() + + py3 vim.current.buffer[:] = None + call assert_equal( line( '.' ), 1 ) + + bwipe! +endfunc + +func Test_Write_To_Current_Buffer_Fixes_Cursor_List() + call _SetUpVisibleBuffer() + + py3 vim.current.buffer[:] = [ 'test' ] + call assert_equal( line( '.' ), 1 ) + + bwipe! +endfunction + +func Test_Write_To_Current_Buffer_Fixes_Cursor_Str() + call _SetUpVisibleBuffer() + + py3 vim.current.buffer[-1] = None + call assert_equal( line( '.' ), 10 ) + + bwipe! +endfunction |