diff options
author | Mike Gerwitz <mike.gerwitz@rtspecialty.com> | 2018-09-06 15:40:34 -0400 |
---|---|---|
committer | Mike Gerwitz <mike.gerwitz@rtspecialty.com> | 2018-09-11 09:30:54 -0400 |
commit | 875ec7634f04fe025886c3f04927e9476c6cd4f5 (patch) | |
tree | d0d4a4b21e60ccaaae71fdb73c9962bfa75b9aec | |
parent | 0e084c15046c301d823cbac928e38162af0c02c4 (diff) | |
download | tame-875ec7634f04fe025886c3f04927e9476c6cd4f5.tar.gz tame-875ec7634f04fe025886c3f04927e9476c6cd4f5.tar.bz2 tame-875ec7634f04fe025886c3f04927e9476c6cd4f5.zip |
insurance (_factor_): Add @allow-negative
* insurance.xml (_factor_)[@allow-negative@]: New param.
-rw-r--r-- | core/insurance.xml | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/core/insurance.xml b/core/insurance.xml index e2e100e..c5203dd 100644 --- a/core/insurance.xml +++ b/core/insurance.xml @@ -206,6 +206,12 @@ </error> </if> + <!-- negative values might be indicitive of a failure to provide a floor + on certain factors when summing (for example) --> + <param name="@allow-negative@" desc="Allow negative value (default false)"> + <text>false</text> + </param> + <param name="@_prefix@" desc="Factor type (drives naming convention)"> <text>factor</text> </param> @@ -254,16 +260,32 @@ <unless name="@generates@" eq=""> <t:assert failure="{@generates@} must not yield a value of 0 for any index"> - <t:match-gt on="@generates@" value="ZERO" /> + <t:match-ne on="@generates@" value="ZERO" /> </t:assert> </unless> <unless name="@yields@" eq=""> <t:assert failure="{@yields@} must not yield a value of 0"> - <t:match-gt on="@yields@" value="ZERO" /> + <t:match-ne on="@yields@" value="ZERO" /> </t:assert> </unless> </unless> </unless> + + <!-- assertion for non-negative --> + <unless name="@allow-negative@" eq="true"> + <unless name="@generates@" eq=""> + <t:assert failure="{@generates@} must not yield a negative value + for any index"> + <t:match-gt on="@generates@" value="ZERO" /> + </t:assert> + </unless> + + <unless name="@yields@" eq=""> + <t:assert failure="{@yields@} must not yield a negative value"> + <t:match-gt on="@yields@" value="ZERO" /> + </t:assert> + </unless> + </unless> </template> </package> |