Mercurial > vim
diff 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 |
line wrap: on
line diff
--- a/src/testdir/test_registers.vim +++ b/src/testdir/test_registers.vim @@ -235,8 +235,16 @@ func Test_get_register() call assert_equal('', getreg("\<C-F>")) call assert_equal('', getreg("\<C-W>")) call assert_equal('', getreg("\<C-L>")) + " Change the last used register to '"' for the next test + normal! ""yy + let @" = 'happy' + call assert_equal('happy', getreg()) + call assert_equal('happy', getreg('')) call assert_equal('', getregtype('!')) + call assert_fails('echo getregtype([])', 'E730:') + call assert_equal('v', getregtype()) + call assert_equal('v', getregtype('')) " Test for inserting an invalid register content call assert_beeps('exe "normal i\<C-R>!"') @@ -316,6 +324,12 @@ func Test_set_register() normal 0".gP call assert_equal('abcabcabc', getline(1)) + let @"='' + call setreg('', '1') + call assert_equal('1', @") + call setreg('@', '2') + call assert_equal('2', @") + enew! endfunc