comparison src/testdir/test_registers.vim @ 19783:546bdeef35f1 v8.2.0448

patch 8.2.0448: various functions not properly tested Commit: https://github.com/vim/vim/commit/0e05de46226eb4e5ea580beefa71831f92d613d3 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 25 22:23:46 2020 +0100 patch 8.2.0448: various functions not properly tested Problem: Various functions not properly tested. Solution: Add more tests, especially for failures. (Yegappan Lakshmanan, closes #5843)
author Bram Moolenaar <Bram@vim.org>
date Wed, 25 Mar 2020 22:30:04 +0100
parents f70a3c1000bb
children 2fb397573541
comparison
equal deleted inserted replaced
19782:e5f4316b01dd 19783:546bdeef35f1
233 call assert_beeps('normal ".yy') 233 call assert_beeps('normal ".yy')
234 234
235 call assert_equal('', getreg("\<C-F>")) 235 call assert_equal('', getreg("\<C-F>"))
236 call assert_equal('', getreg("\<C-W>")) 236 call assert_equal('', getreg("\<C-W>"))
237 call assert_equal('', getreg("\<C-L>")) 237 call assert_equal('', getreg("\<C-L>"))
238 " Change the last used register to '"' for the next test
239 normal! ""yy
240 let @" = 'happy'
241 call assert_equal('happy', getreg())
242 call assert_equal('happy', getreg(''))
238 243
239 call assert_equal('', getregtype('!')) 244 call assert_equal('', getregtype('!'))
245 call assert_fails('echo getregtype([])', 'E730:')
246 call assert_equal('v', getregtype())
247 call assert_equal('v', getregtype(''))
240 248
241 " Test for inserting an invalid register content 249 " Test for inserting an invalid register content
242 call assert_beeps('exe "normal i\<C-R>!"') 250 call assert_beeps('exe "normal i\<C-R>!"')
243 251
244 " Test for inserting a register with multiple lines 252 " Test for inserting a register with multiple lines
314 normal ".gp 322 normal ".gp
315 call assert_equal('abcabc', getline(1)) 323 call assert_equal('abcabc', getline(1))
316 normal 0".gP 324 normal 0".gP
317 call assert_equal('abcabcabc', getline(1)) 325 call assert_equal('abcabcabc', getline(1))
318 326
327 let @"=''
328 call setreg('', '1')
329 call assert_equal('1', @")
330 call setreg('@', '2')
331 call assert_equal('2', @")
332
319 enew! 333 enew!
320 endfunc 334 endfunc
321 335
322 " Test for clipboard registers (* and +) 336 " Test for clipboard registers (* and +)
323 func Test_clipboard_regs() 337 func Test_clipboard_regs()