1- *testing.txt* For Vim version 9.1. Last change: 2024 Jun 17
1+ *testing.txt* For Vim version 9.1. Last change: 2024 Jul 17
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -506,16 +506,17 @@ assert_equal({expected}, {actual} [, {msg}])
506506 added to | v:errors | and 1 is returned. Otherwise zero is
507507 returned. | assert-return |
508508 The error is in the form "Expected {expected} but got
509- {actual} ". When {msg} is present it is prefixed to that.
509+ {actual} ". When {msg} is present it is prefixed to that, along
510+ with the location of the assert when run from a script.
510511
511512 There is no automatic conversion, the String "4" is different
512513 from the Number 4. And the number 4 is different from the
513514 Float 4.0. The value of 'ignorecase' is not used here, case
514515 always matters.
515516 Example: >
516- assert_equal('foo', 'bar')
517- < Will result in a string to be added to | v:errors | :
518- test.vim line 12: Expected 'foo' but got 'bar' ~
517+ call assert_equal('foo', 'bar', 'baz ')
518+ < Will add the following to | v:errors | :
519+ test.vim line 12: baz : Expected 'foo' but got 'bar' ~
519520
520521 Can also be used as a | method | , the base is passed as the
521522 second argument: >
@@ -599,7 +600,8 @@ assert_false({actual} [, {msg}]) *assert_false()*
599600 When {actual} is not false an error message is added to
600601 | v:errors | , like with | assert_equal() | .
601602 The error is in the form "Expected False but got {actual} ".
602- When {msg} is present it is prepended to that.
603+ When {msg} is present it is prepended to that, along
604+ with the location of the assert when run from a script.
603605 Also see | assert-return | .
604606
605607 A value is false when it is zero. When {actual} is not a
@@ -625,7 +627,8 @@ assert_match({pattern}, {actual} [, {msg}])
625627 When {pattern} does not match {actual} an error message is
626628 added to | v:errors | . Also see | assert-return | .
627629 The error is in the form "Pattern {pattern} does not match
628- {actual} ". When {msg} is present it is prefixed to that.
630+ {actual} ". When {msg} is present it is prefixed to that,
631+ along with the location of the assert when run from a script.
629632
630633 {pattern} is used as with | =~ | : The matching is always done
631634 like 'magic' was set and 'cpoptions' is empty, no matter what
@@ -636,7 +639,7 @@ assert_match({pattern}, {actual} [, {msg}])
636639 Use both to match the whole text.
637640
638641 Example: >
639- assert_match('^f.*o$', 'foobar')
642+ assert_match('^f.*o$', 'foobar')
640643< Will result in a string to be added to | v:errors | :
641644 test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~
642645
@@ -693,7 +696,8 @@ assert_true({actual} [, {msg}]) *assert_true()*
693696 Also see | assert-return | .
694697 A value is TRUE when it is a non-zero number. When {actual}
695698 is not a number the assert fails.
696- When {msg} is given it precedes the default message.
699+ When {msg} is given it precedes the default message, along
700+ with the location of the assert when run from a script.
697701
698702 Can also be used as a | method | : >
699703 GetResult()->assert_true()
0 commit comments