changeset 35748:67c12ac8fdf8

runtime(doc): fix more inconsistencies in assert function docs Commit: https://github.com/vim/vim/commit/eb6d733bef312a0634770e023e8a41f0347f1503 Author: zeertzjq <zeertzjq@outlook.com> Date: Thu Jul 18 21:16:05 2024 +0200 runtime(doc): fix more inconsistencies in assert function docs related: https://github.com/vim/vim/pull/15280#issuecomment-2233771449 closes: #15285 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 18 Jul 2024 21:30:06 +0200
parents 73ea9180f2d4
children ca987bbcaf12
files runtime/doc/testing.txt
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -1,4 +1,4 @@
-*testing.txt*	For Vim version 9.1.  Last change: 2024 Jul 17
+*testing.txt*	For Vim version 9.1.  Last change: 2024 Jul 18
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -506,8 +506,8 @@ assert_equal({expected}, {actual} [, {ms
 		added to |v:errors| and 1 is returned.  Otherwise zero is
 		returned. |assert-return|
 		The error is in the form "Expected {expected} but got
-		{actual}".  When {msg} is present it is prefixed to that, along
-		with the location of the assert when run from a script.
+		{actual}".  When {msg} is present it is prefixed to that,
+		along with the location of the assert when run from a script.
 
 		There is no automatic conversion, the String "4" is different
 		from the Number 4.  And the number 4 is different from the
@@ -562,19 +562,19 @@ assert_fails({cmd} [, {error} [, {msg} [
 		When {error} is a string it must be found literally in the
 		first reported error. Most often this will be the error code,
 		including the colon, e.g. "E123:". >
-			assert_fails('bad cmd', 'E987:')
+			call assert_fails('bad cmd', 'E987:')
 <
 		When {error} is a |List| with one or two strings, these are
 		used as patterns.  The first pattern is matched against the
 		first reported error: >
-			assert_fails('cmd', ['E987:.*expected bool'])
+			call assert_fails('cmd', ['E987:.*expected bool'])
 <		The second pattern, if present, is matched against the last
 		reported error.
 		If there is only one error then both patterns must match. This
 		can be used to check that there is only one error.
 		To only match the last error use an empty string for the first
 		error: >
-			assert_fails('cmd', ['', 'E987:'])
+			call assert_fails('cmd', ['', 'E987:'])
 <
 		If {msg} is empty then it is not used.  Do this to get the
 		default message when passing the {lnum} argument.
@@ -600,8 +600,8 @@ assert_false({actual} [, {msg}])			*asse
 		When {actual} is not false an error message is added to
 		|v:errors|, like with |assert_equal()|.
 		The error is in the form "Expected False but got {actual}".
-		When {msg} is present it is prepended to that, along
-		with the location of the assert when run from a script.
+		When {msg} is present it is prefixed to that, along with the
+		location of the assert when run from a script.
 		Also see |assert-return|.
 
 		A value is false when it is zero. When {actual} is not a
@@ -639,9 +639,9 @@ assert_match({pattern}, {actual} [, {msg
 		Use both to match the whole text.
 
 		Example: >
-			assert_match('^f.*o$', 'foobar')
+			call assert_match('^f.*o$', 'foobar')
 <		Will result in a string to be added to |v:errors|:
-	test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~
+			test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~
 
 		Can also be used as a |method|: >
 			getFile()->assert_match('foo.*')
@@ -696,8 +696,8 @@ assert_true({actual} [, {msg}])				*asse
 		Also see |assert-return|.
 		A value is TRUE when it is a non-zero number.  When {actual}
 		is not a number the assert fails.
-		When {msg} is given it precedes the default message, along
-		with the location of the assert when run from a script.
+		When {msg} is given it is prefixed to the default message,
+		along with the location of the assert when run from a script.
 
 		Can also be used as a |method|: >
 			GetResult()->assert_true()