diff src/testdir/test_window_id.vim @ 20178:2fb397573541

patch 8.2.0644: insufficient testing for invalid function arguments Commit: https://github.com/vim/vim/commit/99fa721944dda9d07c53c907c33466728df5c271 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 26 15:59:55 2020 +0200 patch 8.2.0644: insufficient testing for invalid function arguments Problem: Insufficient testing for invalid function arguments. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5988)
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Apr 2020 16:00:04 +0200
parents 068337e86133
children 08940efa6b4e
line wrap: on
line diff
--- a/src/testdir/test_window_id.vim
+++ b/src/testdir/test_window_id.vim
@@ -91,6 +91,10 @@ func Test_win_getid()
   split
   call assert_equal(sort([id5, win_getid()]), sort(win_findbuf(bufnr5)))
 
+  call assert_fails('let w = win_getid([])', 'E745:')
+  call assert_equal(0, win_getid(-1))
+  call assert_equal(-1, win_getid(1, -1))
+
   only!
 endfunc
 
@@ -130,4 +134,8 @@ func Test_winlayout()
   let w2 = win_getid()
   call assert_equal(['leaf', w2], 2->winlayout())
   tabclose
+
+  call assert_equal([], winlayout(-1))
 endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab