Mercurial > vim
diff runtime/doc/testing.txt @ 17825:ce993ba17adb v8.1.1909
patch 8.1.1909: more functions can be used as methods
Commit: https://github.com/vim/vim/commit/e49fbff384e45dd17fed72321c26937edf6de16b
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 21 22:50:07 2019 +0200
patch 8.1.1909: more functions can be used as methods
Problem: More functions can be used as methods.
Solution: Make a few more functions usable as a method.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 21 Aug 2019 23:00:04 +0200 |
parents | f2c2f9126a82 |
children | cc953757ed2a |
line wrap: on
line diff
--- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -238,6 +238,10 @@ assert_equalfile({fname-one}, {fname-two mention that. Mainly useful with |terminal-diff|. + Can also be used as a |method|: > + GetLog()->assert_equalfile('expected.log') + + assert_exception({error} [, {msg}]) *assert_exception()* When v:exception does not contain the string {error} an error message is added to |v:errors|. Also see |assert-return|. @@ -322,10 +326,15 @@ assert_notmatch({pattern}, {actual} [, { 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. + Can also be used as a |method|: > + GetMessage()->assert_report() + + assert_true({actual} [, {msg}]) *assert_true()* When {actual} is not true an error message is added to |v:errors|, like with |assert_equal()|.