Mercurial > vim
comparison runtime/doc/eval.txt @ 13272:abaebba89fd4 v8.0.1510
patch 8.0.1510: cannot test if a command causes a beep
commit https://github.com/vim/vim/commit/b48e96f61c87a64e38e3ac50732c92a84a4833b8
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 13 12:26:14 2018 +0100
patch 8.0.1510: cannot test if a command causes a beep
Problem: Cannot test if a command causes a beep.
Solution: Add assert_beeps().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 13 Feb 2018 12:30:07 +0100 |
parents | dd3b2ecf91f6 |
children | fbda23eb0996 |
comparison
equal
deleted
inserted
replaced
13271:c716b01fb96d | 13272:abaebba89fd4 |
---|---|
2015 argc() Number number of files in the argument list | 2015 argc() Number number of files in the argument list |
2016 argidx() Number current index in the argument list | 2016 argidx() Number current index in the argument list |
2017 arglistid([{winnr} [, {tabnr}]]) Number argument list id | 2017 arglistid([{winnr} [, {tabnr}]]) Number argument list id |
2018 argv({nr}) String {nr} entry of the argument list | 2018 argv({nr}) String {nr} entry of the argument list |
2019 argv() List the argument list | 2019 argv() List the argument list |
2020 assert_beeps({cmd}) none assert {cmd} causes a beep | |
2020 assert_equal({exp}, {act} [, {msg}]) | 2021 assert_equal({exp}, {act} [, {msg}]) |
2021 none assert {exp} is equal to {act} | 2022 none assert {exp} is equal to {act} |
2022 assert_exception({error} [, {msg}]) | 2023 assert_exception({error} [, {msg}]) |
2023 none assert {error} is in v:exception | 2024 none assert {error} is in v:exception |
2024 assert_fails({cmd} [, {error}]) none assert {cmd} fails | 2025 assert_fails({cmd} [, {error}]) none assert {cmd} fails |
2566 : let i = i + 1 | 2567 : let i = i + 1 |
2567 :endwhile | 2568 :endwhile |
2568 < Without the {nr} argument a |List| with the whole |arglist| is | 2569 < Without the {nr} argument a |List| with the whole |arglist| is |
2569 returned. | 2570 returned. |
2570 | 2571 |
2572 assert_beeps({cmd}) *assert_beeps()* | |
2573 Run {cmd} and add an error message to |v:errors| if it does | |
2574 NOT produce a beep or visual bell. | |
2575 Also see |assert_fails()|. | |
2576 | |
2571 *assert_equal()* | 2577 *assert_equal()* |
2572 assert_equal({expected}, {actual} [, {msg}]) | 2578 assert_equal({expected}, {actual} [, {msg}]) |
2573 When {expected} and {actual} are not equal an error message is | 2579 When {expected} and {actual} are not equal an error message is |
2574 added to |v:errors|. | 2580 added to |v:errors|. |
2575 There is no automatic conversion, the String "4" is different | 2581 There is no automatic conversion, the String "4" is different |
2598 | 2604 |
2599 assert_fails({cmd} [, {error}]) *assert_fails()* | 2605 assert_fails({cmd} [, {error}]) *assert_fails()* |
2600 Run {cmd} and add an error message to |v:errors| if it does | 2606 Run {cmd} and add an error message to |v:errors| if it does |
2601 NOT produce an error. | 2607 NOT produce an error. |
2602 When {error} is given it must match in |v:errmsg|. | 2608 When {error} is given it must match in |v:errmsg|. |
2609 Note that beeping is not considered an error, and some failing | |
2610 commands only beep. Use |assert_beeps()| for those. | |
2603 | 2611 |
2604 assert_false({actual} [, {msg}]) *assert_false()* | 2612 assert_false({actual} [, {msg}]) *assert_false()* |
2605 When {actual} is not false an error message is added to | 2613 When {actual} is not false an error message is added to |
2606 |v:errors|, like with |assert_equal()|. | 2614 |v:errors|, like with |assert_equal()|. |
2607 A value is false when it is zero. When {actual} is not a | 2615 A value is false when it is zero. When {actual} is not a |