comparison runtime/doc/eval.txt @ 9636:ccbb8e393d80 v7.4.2095

commit https://github.com/vim/vim/commit/61c04493b00f85d0b97436260a9ef9ab82143b78 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 23 15:35:35 2016 +0200 patch 7.4.2095 Problem: Man test fails when run with the GUI. Solution: Adjust for different behavior of GUI. Add assert_inrange().
author Christian Brabandt <cb@256bit.org>
date Sat, 23 Jul 2016 15:45:05 +0200
parents 172131507c85
children 9f7bcc2c3b97
comparison
equal deleted inserted replaced
9635:974a40c76e19 9636:ccbb8e393d80
1 *eval.txt* For Vim version 7.4. Last change: 2016 Jul 22 1 *eval.txt* For Vim version 7.4. Last change: 2016 Jul 23
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
1945 argv() List the argument list 1945 argv() List the argument list
1946 assert_equal({exp}, {act} [, {msg}]) none assert {exp} is equal to {act} 1946 assert_equal({exp}, {act} [, {msg}]) none assert {exp} is equal to {act}
1947 assert_exception({error} [, {msg}]) none assert {error} is in v:exception 1947 assert_exception({error} [, {msg}]) none assert {error} is in v:exception
1948 assert_fails({cmd} [, {error}]) none assert {cmd} fails 1948 assert_fails({cmd} [, {error}]) none assert {cmd} fails
1949 assert_false({actual} [, {msg}]) none assert {actual} is false 1949 assert_false({actual} [, {msg}]) none assert {actual} is false
1950 assert_inrange({lower}, {upper}, {actual} [, {msg}])
1951 none assert {actual} is inside the range
1950 assert_match({pat}, {text} [, {msg}]) none assert {pat} matches {text} 1952 assert_match({pat}, {text} [, {msg}]) none assert {pat} matches {text}
1951 assert_notequal({exp}, {act} [, {msg}]) none assert {exp} is not equal {act} 1953 assert_notequal({exp}, {act} [, {msg}]) none assert {exp} is not equal {act}
1952 assert_notmatch({pat}, {text} [, {msg}]) none assert {pat} not matches {text} 1954 assert_notmatch({pat}, {text} [, {msg}]) none assert {pat} not matches {text}
1953 assert_true({actual} [, {msg}]) none assert {actual} is true 1955 assert_true({actual} [, {msg}]) none assert {actual} is true
1954 asin({expr}) Float arc sine of {expr} 1956 asin({expr}) Float arc sine of {expr}
2476 assert_false({actual} [, {msg}]) *assert_false()* 2478 assert_false({actual} [, {msg}]) *assert_false()*
2477 When {actual} is not false an error message is added to 2479 When {actual} is not false an error message is added to
2478 |v:errors|, like with |assert_equal()|. 2480 |v:errors|, like with |assert_equal()|.
2479 A value is false when it is zero. When {actual} is not a 2481 A value is false when it is zero. When {actual} is not a
2480 number the assert fails. 2482 number the assert fails.
2481 When {msg} is omitted an error in the form "Expected False but 2483 When {msg} is omitted an error in the form
2482 got {actual}" is produced. 2484 "Expected False but got {actual}" is produced.
2485
2486 assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()*
2487 This asserts number values. When {actual} is lower than
2488 {lower} or higher than {upper} an error message is added to
2489 |v:errors|.
2490 When {msg} is omitted an error in the form
2491 "Expected range {lower} - {upper}, but got {actual}" is
2492 produced.
2483 2493
2484 *assert_match()* 2494 *assert_match()*
2485 assert_match({pattern}, {actual} [, {msg}]) 2495 assert_match({pattern}, {actual} [, {msg}])
2486 When {pattern} does not match {actual} an error message is 2496 When {pattern} does not match {actual} an error message is
2487 added to |v:errors|. 2497 added to |v:errors|.
2492 2502
2493 {actual} is used as a string, automatic conversion applies. 2503 {actual} is used as a string, automatic conversion applies.
2494 Use "^" and "$" to match with the start and end of the text. 2504 Use "^" and "$" to match with the start and end of the text.
2495 Use both to match the whole text. 2505 Use both to match the whole text.
2496 2506
2497 When {msg} is omitted an error in the form "Pattern {pattern} 2507 When {msg} is omitted an error in the form
2498 does not match {actual}" is produced. 2508 "Pattern {pattern} does not match {actual}" is produced.
2499 Example: > 2509 Example: >
2500 assert_match('^f.*o$', 'foobar') 2510 assert_match('^f.*o$', 'foobar')
2501 < Will result in a string to be added to |v:errors|: 2511 < Will result in a string to be added to |v:errors|:
2502 test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~ 2512 test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~
2503 2513