*vital-assertion.txt* assertion library. Maintainer: rbtnn ============================================================================== CONTENTS *Vital.Assertion-contents* INTRODUCTION |Vital.Assertion-introduction| INTERFACE |Vital.Assertion-interface| FUNCTIONS |Vital.Assertion-functions| ============================================================================== INTRODUCTION *Vital.Assertion-introduction* *Vital.Assertion* is assertion library. ============================================================================== INTERFACE *Vital.Assertion-interface* ------------------------------------------------------------------------------ FUNCTIONS *Vital.Assertion-functions* define({assert_command_name}, ...) *Vital.Assertion.define()* Define a command of Vital.Assertion that is named {assert_command_name}. {a:1} is a bool value to enable the command defined by `define()`. Default value of {a:1} is `0`. A command defined by `define()` has two operators. A. <=> It means 'equal'. 1) Succeeded > let s:V = vital#of('vital') let s:A = s:V.import('Assertion') call s:A.define('Assert', 1) Assert 1 <=> 1 " Assert 2 <=> 2 :Succeeded < 2) Failed > let s:V = vital#of('vital') let s:A = s:V.import('Assertion') call s:A.define('Assert', 1) Assert 0 <=> 1 " Assert 3 <=> 2 :Failed " > assert_point: /private/var/folders/66/zvrbqcn97238kw4b_qqdl__c0000gn/T/vdrqOUi/6, line 7 " > lhs: 3 " > rhs: 2 " function 140__assertion..140__outputter, line 15 < B. It means 'not equal'. 1) Succeeded > let s:V = vital#of('vital') let s:A = s:V.import('Assertion') call s:A.define('Assert', 1) Assert 3 2 " Assert 3 2 :Succeeded < 2) Failed > let s:V = vital#of('vital') let s:A = s:V.import('Assertion') call s:A.define('Assert', 1) function! s:hoge() endfunction function! s:foo() " it can be used in a function. Assert 3 3 " a script function can not be used. " Assert 3 s:hoge() endfunction call s:foo() " Assert 3 3 :Failed " > assert_point: function 183_foo, line 1 " > lhs: 3 " > rhs: 3 " function 183_foo..140__assertion..140__outputter, line 15 < ============================================================================== vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl