Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
17824:ec91bfac242e | 17825:ce993ba17adb |
---|---|
236 Also see |assert-return|. | 236 Also see |assert-return|. |
237 When {fname-one} or {fname-two} does not exist the error will | 237 When {fname-one} or {fname-two} does not exist the error will |
238 mention that. | 238 mention that. |
239 Mainly useful with |terminal-diff|. | 239 Mainly useful with |terminal-diff|. |
240 | 240 |
241 Can also be used as a |method|: > | |
242 GetLog()->assert_equalfile('expected.log') | |
243 | |
244 | |
241 assert_exception({error} [, {msg}]) *assert_exception()* | 245 assert_exception({error} [, {msg}]) *assert_exception()* |
242 When v:exception does not contain the string {error} an error | 246 When v:exception does not contain the string {error} an error |
243 message is added to |v:errors|. Also see |assert-return|. | 247 message is added to |v:errors|. Also see |assert-return|. |
244 This can be used to assert that a command throws an exception. | 248 This can be used to assert that a command throws an exception. |
245 Using the error number, followed by a colon, avoids problems | 249 Using the error number, followed by a colon, avoids problems |
320 Also see |assert-return|. | 324 Also see |assert-return|. |
321 | 325 |
322 Can also be used as a |method|: > | 326 Can also be used as a |method|: > |
323 getFile()->assert_notmatch('bar.*') | 327 getFile()->assert_notmatch('bar.*') |
324 | 328 |
329 | |
325 assert_report({msg}) *assert_report()* | 330 assert_report({msg}) *assert_report()* |
326 Report a test failure directly, using {msg}. | 331 Report a test failure directly, using {msg}. |
327 Always returns one. | 332 Always returns one. |
333 | |
334 Can also be used as a |method|: > | |
335 GetMessage()->assert_report() | |
336 | |
328 | 337 |
329 assert_true({actual} [, {msg}]) *assert_true()* | 338 assert_true({actual} [, {msg}]) *assert_true()* |
330 When {actual} is not true an error message is added to | 339 When {actual} is not true an error message is added to |
331 |v:errors|, like with |assert_equal()|. | 340 |v:errors|, like with |assert_equal()|. |
332 Also see |assert-return|. | 341 Also see |assert-return|. |