patch 8.1.1861: only some assert functions can be used as a method
Problem: Only some assert functions can be used as a method.
Solution: Allow using most assert functions as a method.
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index b51a1e1..0dbe014 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -206,6 +206,9 @@
NOT produce a beep or visual bell.
Also see |assert_fails()| and |assert-return|.
+ Can also be used as a |method|: >
+ GetCmd()->assert_beeps()
+<
*assert_equal()*
assert_equal({expected}, {actual} [, {msg}])
When {expected} and {actual} are not equal an error message is
@@ -255,6 +258,9 @@
Note that beeping is not considered an error, and some failing
commands only beep. Use |assert_beeps()| for those.
+ Can also be used as a |method|: >
+ GetCmd()->assert_fails('E99:')
+
assert_false({actual} [, {msg}]) *assert_false()*
When {actual} is not false an error message is added to
|v:errors|, like with |assert_equal()|.
@@ -264,6 +270,9 @@
When {msg} is omitted an error in the form
"Expected False but got {actual}" is produced.
+ Can also be used as a |method|: >
+ GetResult()->assert_false()
+
assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()*
This asserts number and |Float| values. When {actual} is lower
than {lower} or higher than {upper} an error message is added
@@ -292,6 +301,9 @@
< Will result in a string to be added to |v:errors|:
test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~
+ Can also be used as a |method|: >
+ getFile()->assert_match('foo.*')
+<
*assert_notequal()*
assert_notequal({expected}, {actual} [, {msg}])
The opposite of `assert_equal()`: add an error message to
@@ -307,6 +319,9 @@
|v:errors| when {pattern} matches {actual}.
Also see |assert-return|.
+ Can also be used as a |method|: >
+ getFile()->assert_notmatch('bar.*')
+
assert_report({msg}) *assert_report()*
Report a test failure directly, using {msg}.
Always returns one.
@@ -320,5 +335,8 @@
When {msg} is omitted an error in the form "Expected True but
got {actual}" is produced.
+ Can also be used as a |method|: >
+ GetResult()->assert_true()
+<
vim:tw=78:ts=8:noet:ft=help:norl: