Mercurial > vim
comparison src/testdir/test_registers.vim @ 24695:13efbfc53054 v8.2.2886
patch 8.2.2886: various pieces of code not covered by tests
Commit: https://github.com/vim/vim/commit/34fcb697240c1bc9e69417ed75db3b1a83479724
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Tue May 25 20:14:00 2021 +0200
patch 8.2.2886: various pieces of code not covered by tests
Problem: Various pieces of code not covered by tests.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8255)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 25 May 2021 20:15:03 +0200 |
parents | 72e9b861bc92 |
children | b1440083f0da |
comparison
equal
deleted
inserted
replaced
24694:44426ac4b715 | 24695:13efbfc53054 |
---|---|
279 call assert_beeps('norm! c"') | 279 call assert_beeps('norm! c"') |
280 endfunc | 280 endfunc |
281 | 281 |
282 func Test_set_register() | 282 func Test_set_register() |
283 call assert_fails("call setreg('#', 200)", 'E86:') | 283 call assert_fails("call setreg('#', 200)", 'E86:') |
284 call assert_fails("call setreg('a', test_unknown())", 'E908:') | |
284 | 285 |
285 edit Xfile_alt_1 | 286 edit Xfile_alt_1 |
286 let b1 = bufnr('') | 287 let b1 = bufnr('') |
287 edit Xfile_alt_2 | 288 edit Xfile_alt_2 |
288 let b2 = bufnr('') | 289 let b2 = bufnr('') |
467 call assert_equal(getregtype('z'), info.regtype) | 468 call assert_equal(getregtype('z'), info.regtype) |
468 call assert_equal(1, +info.isunnamed) | 469 call assert_equal(1, +info.isunnamed) |
469 | 470 |
470 let info = getreginfo('"') | 471 let info = getreginfo('"') |
471 call assert_equal('z', info.points_to) | 472 call assert_equal('z', info.points_to) |
473 | |
474 let @a="a1b2" | |
475 nnoremap <F2> <Cmd>let g:RegInfo = getreginfo()<CR> | |
476 exe "normal \"a\<F2>" | |
477 call assert_equal({'regcontents': ['a1b2'], 'isunnamed': v:false, | |
478 \ 'regtype': 'v'}, g:RegInfo) | |
479 nunmap <F2> | |
480 unlet g:RegInfo | |
472 | 481 |
473 bwipe! | 482 bwipe! |
474 endfunc | 483 endfunc |
475 | 484 |
476 " Test for restoring register with dict from getreginfo | 485 " Test for restoring register with dict from getreginfo |