Mercurial > vim
comparison src/testdir/test_usercommands.vim @ 19724:b3e93a05c3ca v8.2.0418
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Commit: https://github.com/vim/vim/commit/8b633135106dda8605463b780573c45b00c22afe
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Mar 20 18:20:51 2020 +0100
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Problem: Code in eval.c not sufficiently covered by tests.
Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5815)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 20 Mar 2020 18:30:05 +0100 |
parents | 9199f34d838e |
children | d13f8ae3b1de |
comparison
equal
deleted
inserted
replaced
19723:16aa117306ec | 19724:b3e93a05c3ca |
---|---|
547 comclear | 547 comclear |
548 call assert_equal("\nNo user-defined commands found", execute(':command Xxx')) | 548 call assert_equal("\nNo user-defined commands found", execute(':command Xxx')) |
549 call assert_equal("\nNo user-defined commands found", execute('command')) | 549 call assert_equal("\nNo user-defined commands found", execute('command')) |
550 endfunc | 550 endfunc |
551 | 551 |
552 " Test for a custom user completion returning the wrong value type | |
553 func Test_usercmd_custom() | |
554 func T1(a, c, p) | |
555 return "a\nb\n" | |
556 endfunc | |
557 command -nargs=* -complete=customlist,T1 TCmd1 | |
558 call feedkeys(":T1 \<C-A>\<C-B>\"\<CR>", 'xt') | |
559 call assert_equal('"T1 ', @:) | |
560 delcommand TCmd1 | |
561 delfunc T1 | |
562 | |
563 func T2(a, c, p) | |
564 return ['a', 'b', 'c'] | |
565 endfunc | |
566 command -nargs=* -complete=customlist,T2 TCmd2 | |
567 call feedkeys(":T2 \<C-A>\<C-B>\"\<CR>", 'xt') | |
568 call assert_equal('"T2 ', @:) | |
569 delcommand TCmd2 | |
570 delfunc T2 | |
571 endfunc | |
572 | |
552 " vim: shiftwidth=2 sts=2 expandtab | 573 " vim: shiftwidth=2 sts=2 expandtab |