Mercurial > vim
diff src/testdir/test_bufline.vim @ 23788:d12ef361d9de v8.2.2435
patch 8.2.2435: setline() gives an error for some types
Commit: https://github.com/vim/vim/commit/3445320839a38b3b0c253513b125da8298ec27d6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 31 13:08:38 2021 +0100
patch 8.2.2435: setline() gives an error for some types
Problem: setline() gives an error for some types.
Solution: Allow any type, convert each item to a string.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 31 Jan 2021 13:15:04 +0100 |
parents | 08940efa6b4e |
children | 54b583156d53 |
line wrap: on
line diff
--- a/src/testdir/test_bufline.vim +++ b/src/testdir/test_bufline.vim @@ -5,6 +5,7 @@ source screendump.vim source check.vim func Test_setbufline_getbufline() + " similar to Test_set_get_bufline() new let b = bufnr('%') hide @@ -38,6 +39,12 @@ func Test_setbufline_getbufline() call assert_equal(['e'], getbufline(b, 5)) call assert_equal([], getbufline(b, 6)) call assert_equal([], getbufline(b, 2, 1)) + + call setbufline(b, 2, [function('eval'), #{key: 123}, test_null_job()]) + call assert_equal(["function('eval')", + \ "{'key': 123}", + \ "no process"], + \ getbufline(b, 2, 4)) exe "bwipe! " . b endfunc