comparison src/testdir/test_usercommands.vim @ 20128:0b35a7ffceb2 v8.2.0619

patch 8.2.0619: null dict is not handled like an empty dict Commit: https://github.com/vim/vim/commit/ea04a6e8baff2f27da7cdd54bf70a5525994f76d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 23 13:38:02 2020 +0200 patch 8.2.0619: null dict is not handled like an empty dict Problem: Null dict is not handled like an empty dict. Solution: Fix the code and add tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5968)
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Apr 2020 13:45:04 +0200
parents d13f8ae3b1de
children 49694eceaa55
comparison
equal deleted inserted replaced
20127:a62c4185482f 20128:0b35a7ffceb2
585 func Test_usercmd_custom() 585 func Test_usercmd_custom()
586 func T1(a, c, p) 586 func T1(a, c, p)
587 return "a\nb\n" 587 return "a\nb\n"
588 endfunc 588 endfunc
589 command -nargs=* -complete=customlist,T1 TCmd1 589 command -nargs=* -complete=customlist,T1 TCmd1
590 call feedkeys(":T1 \<C-A>\<C-B>\"\<CR>", 'xt') 590 call feedkeys(":TCmd1 \<C-A>\<C-B>\"\<CR>", 'xt')
591 call assert_equal('"T1 ', @:) 591 call assert_equal('"TCmd1 ', @:)
592 delcommand TCmd1 592 delcommand TCmd1
593 delfunc T1 593 delfunc T1
594 594
595 func T2(a, c, p) 595 func T2(a, c, p)
596 return ['a', 'b', 'c'] 596 return {}
597 endfunc 597 endfunc
598 command -nargs=* -complete=customlist,T2 TCmd2 598 command -nargs=* -complete=customlist,T2 TCmd2
599 call feedkeys(":T2 \<C-A>\<C-B>\"\<CR>", 'xt') 599 call feedkeys(":TCmd2 \<C-A>\<C-B>\"\<CR>", 'xt')
600 call assert_equal('"T2 ', @:) 600 call assert_equal('"TCmd2 ', @:)
601 delcommand TCmd2 601 delcommand TCmd2
602 delfunc T2 602 delfunc T2
603 endfunc 603 endfunc
604 604
605 " vim: shiftwidth=2 sts=2 expandtab 605 " vim: shiftwidth=2 sts=2 expandtab