Home Explore Blog CI



neovim

6th chunk of `runtime/doc/vimfn.txt`
a955b7e11aa707f2b8f9edcd0c56c31513c70b3cc165a1ad0000000100000fc2
           *assert_notequal()*
		The opposite of `assert_equal()`: add an error message to
		|v:errors| when {expected} and {actual} are equal.
		Also see |assert-return|.

                Parameters: ~
                  • {expected} (`any`)
                  • {actual} (`any`)
                  • {msg} (`any?`)

                Return: ~
                  (`0|1`)

assert_notmatch({pattern}, {actual} [, {msg}])               *assert_notmatch()*
		The opposite of `assert_match()`: add an error message to
		|v:errors| when {pattern} matches {actual}.
		Also see |assert-return|.

                Parameters: ~
                  • {pattern} (`string`)
                  • {actual} (`string`)
                  • {msg} (`string?`)

                Return: ~
                  (`0|1`)

assert_report({msg})                                           *assert_report()*
		Report a test failure directly, using String {msg}.
		Always returns one.

                Parameters: ~
                  • {msg} (`string`)

                Return: ~
                  (`0|1`)

assert_true({actual} [, {msg}])                                  *assert_true()*
		When {actual} is not true an error message is added to
		|v:errors|, like with |assert_equal()|.
		Also see |assert-return|.
		A value is |TRUE| when it is a non-zero number or |v:true|.
		When {actual} is not a number or |v:true| the assert fails.
		When {msg} is given it is prefixed to the default message,
		along with the location of the assert when run from a script.

                Parameters: ~
                  • {actual} (`any`)
                  • {msg} (`string?`)

                Return: ~
                  (`0|1`)

atan({expr})                                                            *atan()*
		Return the principal value of the arc tangent of {expr}, in
		the range [-pi/2, +pi/2] radians, as a |Float|.
		{expr} must evaluate to a |Float| or a |Number|.
		Returns 0.0 if {expr} is not a |Float| or a |Number|.
		Examples: >vim
			echo atan(100)
<			1.560797 >vim
			echo atan(-4.01)
<			-1.326405

                Parameters: ~
                  • {expr} (`number`)

                Return: ~
                  (`number`)

atan2({expr1}, {expr2})                                                *atan2()*
		Return the arc tangent of {expr1} / {expr2}, measured in
		radians, as a |Float| in the range [-pi, pi].
		{expr1} and {expr2} must evaluate to a |Float| or a |Number|.
		Returns 0.0 if {expr1} or {expr2} is not a |Float| or a
		|Number|.
		Examples: >vim
			echo atan2(-1, 1)
<			-0.785398 >vim
			echo atan2(1, -1)
<			2.356194

                Parameters: ~
                  • {expr1} (`number`)
                  • {expr2} (`number`)

                Return: ~
                  (`number`)

blob2list({blob})                                                  *blob2list()*
		Return a List containing the number value of each byte in Blob
		{blob}.  Examples: >vim
			blob2list(0z0102.0304)	" returns [1, 2, 3, 4]
			blob2list(0z)		" returns []
<		Returns an empty List on error.  |list2blob()| does the
		opposite.

                Parameters: ~
                  • {blob} (`any`)

                Return: ~
                  (`any[]`)

browse({save}, {title}, {initdir}, {default})                         *browse()*
		Put up a file requester.  This only works when "has("browse")"
		returns |TRUE| (only in some GUI versions).
		The input fields are:
		    {save}	when |TRUE|, select file to write
		    {title}	title for the requester
		    {initdir}	directory to start browsing in
		    {default}	default file name
		An empty string is returned when the "Cancel" button is hit,
		something went wrong, or browsing is not possible.

                Parameters: ~
                  • {save} (`any`)
                  • {title} (`string`)
                  • {initdir} (`string`)
                  • {default} (`string`)

                Return: ~
                  (`0|1`)

browsedir({title}, {initdir})            

Title: Vimscript Built-in Functions: Assertion, Trigonometry, Blob Conversion, and File Browsing
Summary
This section of the Vimscript documentation details the `assert_notequal()`, `assert_notmatch()`, `assert_report()`, `assert_true()`, `atan()`, `atan2()`, `blob2list()`, `browse()`, and `browsedir()` functions. The functions' parameters and return values are described. `assert_notequal()` and `assert_notmatch()` are opposites of `assert_equal()` and `assert_match()` respectively, adding errors to |v:errors| when the conditions they check are true. `assert_report()` reports a test failure directly. `assert_true()` adds an error if its argument is not a non-zero number or |v:true|. `atan()` and `atan2()` return arc tangents. `blob2list()` converts a Blob to a List of byte values. `browse()` and `browsedir()` put up file/directory requester windows.