aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-18 13:39:22 -0400
committerGitHub <noreply@github.com>2020-10-18 13:39:22 -0400
commiteaee3d9297d114c81b05dd4ed104373eeb87bc11 (patch)
tree8ae0373b3176bb2535c2da4daabc118c0520b1b9 /src/nvim/testdir
parent9817d991403ea3646b9a01234d12c7661ff8c62b (diff)
parentce99d049e787e96eaf6268907262240321dae881 (diff)
downloadrneovim-eaee3d9297d114c81b05dd4ed104373eeb87bc11.tar.gz
rneovim-eaee3d9297d114c81b05dd4ed104373eeb87bc11.tar.bz2
rneovim-eaee3d9297d114c81b05dd4ed104373eeb87bc11.zip
Merge pull request #13111 from janlazo/vim-8.2.0862
vim-patch:8.2.{862,943,1547}
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_display.vim24
-rw-r--r--src/nvim/testdir/test_put.vim26
2 files changed, 36 insertions, 14 deletions
diff --git a/src/nvim/testdir/test_display.vim b/src/nvim/testdir/test_display.vim
index a177f6140e..66b016c8b2 100644
--- a/src/nvim/testdir/test_display.vim
+++ b/src/nvim/testdir/test_display.vim
@@ -202,6 +202,30 @@ func Test_edit_long_file_name()
call delete(longName)
endfunc
+func Test_unprintable_fileformats()
+ CheckScreendump
+
+ call writefile(["unix\r", "two"], 'Xunix.txt')
+ call writefile(["mac\r", "two"], 'Xmac.txt')
+ let lines =<< trim END
+ edit Xunix.txt
+ split Xmac.txt
+ edit ++ff=mac
+ END
+ let filename = 'Xunprintable'
+ call writefile(lines, filename)
+ let buf = RunVimInTerminal('-S '.filename, #{rows: 9, cols: 50})
+ call VerifyScreenDump(buf, 'Test_display_unprintable_01', {})
+ call term_sendkeys(buf, "\<C-W>\<C-W>\<C-L>")
+ call VerifyScreenDump(buf, 'Test_display_unprintable_02', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('Xunix.txt')
+ call delete('Xmac.txt')
+ call delete(filename)
+endfunc
+
" Test for scrolling that modifies buffer during visual block
func Test_visual_block_scroll()
" See test/functional/legacy/visual_mode_spec.lua
diff --git a/src/nvim/testdir/test_put.vim b/src/nvim/testdir/test_put.vim
index 884ada7e88..15745d5619 100644
--- a/src/nvim/testdir/test_put.vim
+++ b/src/nvim/testdir/test_put.vim
@@ -22,12 +22,21 @@ endfunc
func Test_put_char_block2()
new
- let a = [ getreg('a'), getregtype('a') ]
call setreg('a', ' one ', 'v')
call setline(1, ['Line 1', '', 'Line 3', ''])
" visually select the first 3 lines and put register a over it
exe "norm! ggl\<c-v>2j2l\"ap"
- call assert_equal(['L one 1', '', 'L one 3', ''], getline(1,4))
+ call assert_equal(['L one 1', '', 'L one 3', ''], getline(1, 4))
+ " clean up
+ bw!
+endfunc
+
+func Test_put_lines()
+ new
+ let a = [ getreg('a'), getregtype('a') ]
+ call setline(1, ['Line 1', 'Line2', 'Line 3', ''])
+ exe 'norm! gg"add"AddG""p'
+ call assert_equal(['Line 3', '', 'Line 1', 'Line2'], getline(1, '$'))
" clean up
bw!
call setreg('a', a[0], a[1])
@@ -42,21 +51,10 @@ func Test_put_expr()
exec "4norm! \"=\<cr>P"
norm! j0.
norm! j0.
- call assert_equal(['A1','A2','A3','4A','5A','6A'], getline(1,'$'))
+ call assert_equal(['A1','A2','A3','4A','5A','6A'], getline(1, '$'))
bw!
endfunc
-func Test_put_lines()
- new
- let a = [ getreg('a'), getregtype('a') ]
- call setline(1, ['Line 1', 'Line2', 'Line 3', ''])
- exe 'norm! gg"add"AddG""p'
- call assert_equal(['Line 3', '', 'Line 1', 'Line2'], getline(1,'$'))
- " clean up
- bw!
- call setreg('a', a[0], a[1])
-endfunc
-
func Test_put_fails_when_nomodifiable()
new
setlocal nomodifiable