Mercurial > vim
comparison src/testdir/test_functions.vim @ 19742:810eee1b42e3 v8.2.0427
patch 8.2.0427: it is not possible to check for a typo in a feature name
Commit: https://github.com/vim/vim/commit/7929651e05b081fe55e0e745725a7ad78c51be16
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 22 16:17:14 2020 +0100
patch 8.2.0427: it is not possible to check for a typo in a feature name
Problem: It is not possible to check for a typo in a feature name.
Solution: Add an extra argument to has().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 22 Mar 2020 16:30:03 +0100 |
parents | b3e93a05c3ca |
children | 546bdeef35f1 |
comparison
equal
deleted
inserted
replaced
19741:350dcc40421f | 19742:810eee1b42e3 |
---|---|
16 call assert_equal(1, bufexists(getcwd() . '/Xfoo')) | 16 call assert_equal(1, bufexists(getcwd() . '/Xfoo')) |
17 call assert_equal(1, bufexists(0)) | 17 call assert_equal(1, bufexists(0)) |
18 bw | 18 bw |
19 call assert_equal(0, bufexists(bn)) | 19 call assert_equal(0, bufexists(bn)) |
20 call assert_equal(0, bufexists('Xfoo')) | 20 call assert_equal(0, bufexists('Xfoo')) |
21 endfunc | |
22 | |
23 func Test_has() | |
24 call assert_equal(1, has('eval')) | |
25 call assert_equal(1, has('eval', 1)) | |
26 | |
27 call assert_equal(0, has('nonexistent')) | |
28 call assert_equal(0, has('nonexistent', 1)) | |
21 endfunc | 29 endfunc |
22 | 30 |
23 func Test_empty() | 31 func Test_empty() |
24 call assert_equal(1, empty('')) | 32 call assert_equal(1, empty('')) |
25 call assert_equal(0, empty('a')) | 33 call assert_equal(0, empty('a')) |
1584 call feedkeys('n', 'L') | 1592 call feedkeys('n', 'L') |
1585 let a = confirm('Are you sure?', "&Yes\n&No") | 1593 let a = confirm('Are you sure?', "&Yes\n&No") |
1586 call assert_equal(2, a) | 1594 call assert_equal(2, a) |
1587 | 1595 |
1588 " confirm() should return 0 when pressing CTRL-C. | 1596 " confirm() should return 0 when pressing CTRL-C. |
1589 call feedkeys("\<C-c>", 'L') | 1597 call feedkeys("\<C-C>", 'L') |
1590 let a = confirm('Are you sure?', "&Yes\n&No") | 1598 let a = confirm('Are you sure?', "&Yes\n&No") |
1591 call assert_equal(0, a) | 1599 call assert_equal(0, a) |
1592 | 1600 |
1593 " <Esc> requires another character to avoid it being seen as the start of an | 1601 " <Esc> requires another character to avoid it being seen as the start of an |
1594 " escape sequence. Zero should be harmless. | 1602 " escape sequence. Zero should be harmless. |