Mercurial > vim
diff src/testdir/test_vim9_func.vim @ 22039:f040df1bd219 v8.2.1569
patch 8.2.1569: Vim9: fixes not tested; failure in getchangelist()
Commit: https://github.com/vim/vim/commit/a5d3841177e0b3545381c875d0b4b442f38784bd
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 2 21:02:35 2020 +0200
patch 8.2.1569: Vim9: fixes not tested; failure in getchangelist()
Problem: Vim9: fixes for functions not tested; failure in getchangelist().
Solution: Add tests. (closes https://github.com/vim/vim/issues/6813, closes https://github.com/vim/vim/issues/6815, closes https://github.com/vim/vim/issues/6817)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 02 Sep 2020 21:15:03 +0200 |
parents | ee967cdcf749 |
children | 4bc644f4dd2d |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1431,6 +1431,39 @@ def Test_setbufvar() assert_equal(123, getbufvar('%', 'myvar')) enddef +def Test_bufwinid() + let origwin = win_getid() + below split SomeFile + let SomeFileID = win_getid() + below split OtherFile + below split SomeFile + assert_equal(SomeFileID, bufwinid('SomeFile')) + + win_gotoid(origwin) + only + bwipe SomeFile + bwipe OtherFile +enddef + +def Test_getbufline() + e SomeFile + let buf = bufnr() + e # + let lines = ['aaa', 'bbb', 'ccc'] + setbufline(buf, 1, lines) + assert_equal(lines, getbufline('#', 1, '$')) + + bwipe! +enddef + +def Test_getchangelist() + new + setline(1, 'some text') + let changelist = bufnr()->getchangelist() + assert_equal(changelist, getchangelist('%')) + bwipe! +enddef + def Test_setreg() setreg('a', ['aaa', 'bbb', 'ccc']) let reginfo = getreginfo('a')