Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-01-09 15:05:59 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-09-11 09:30:52 -0400
commit886b1eb234c91d48208e4025a1b4af466bb0fbf0 (patch)
tree29b4629598dbd3b937d4a7decfa6a944b8b15855
parentc74333b1cef289765b9da56984550b1def22fe91 (diff)
downloadtame-886b1eb234c91d48208e4025a1b4af466bb0fbf0.tar.gz
tame-886b1eb234c91d48208e4025a1b4af466bb0fbf0.tar.bz2
tame-886b1eb234c91d48208e4025a1b4af466bb0fbf0.zip
assert: _assert-nonzero_ to replace _fail-on-empty_ (alias added)
Keep things consistent. A deprecation warning will be displayed for `_fail-on-empty_'. * assert.xml (_assert-nonzero_): Rename from `_fail-on-empty'. (_fail-on-empty_): Alias to `_assert-nonzero'. Display deprecation warning.
-rw-r--r--core/assert.xml42
1 files changed, 33 insertions, 9 deletions
diff --git a/core/assert.xml b/core/assert.xml
index 5532fff..f810b16 100644
--- a/core/assert.xml
+++ b/core/assert.xml
@@ -89,17 +89,15 @@
<section title="Standard Assertions">
- There is currently one standard assertion---\ref{_fail-on-empty_}.
+ There is currently one standard assertion---
+ \ref{_assert-nonzero_} (also called \ref{_fail-on-empty_}.
- \ref{_fail-on-empty_} terminates if \ref{_fail-on-empty_/@name@}
- is zero,
- subject to \ref{_fail-on-empty_/@when@},
- \ref{_fail-on-empty_/@class@}, and any other provided predicates.
+ \ref{_assert-nonzero_} terminates if \tt{@name@} is zero,
+ subject to \tt{@when@},
+ \tt{@class@},
+ and any other provided predicates.
- The name of this assertion is likely to change in the future,
- but a~template will be added in its place providing deprecation notices.
-
- <template name="_fail-on-empty_"
+ <template name="_assert-nonzero_"
desc="Fail when a value is zero">
<param name="@values@" desc="Optional predicates to include in match" />
<param name="@name@" desc="Data to check (scalar, vector or otherwise)" />
@@ -132,5 +130,31 @@
<t:match-ne on="@name@" value="ZERO" />
</t:assert>
</template>
+
+
+ This template was previously named \ref{_fail-on-empty_},
+ so an alias is provided for backwards-compatibility.
+ Note that it will display a deprecation warning.
+
+ <template name="_fail-on-empty_"
+ desc="Fail when a value is zero (alias for _assert-nonzero_)">
+ <param name="@values@" desc="Optional predicates to include in match" />
+ <param name="@name@" desc="Data to check (scalar, vector or otherwise)" />
+ <param name="@when@" desc="Conditional check (optional)" />
+ <param name="@class@" desc="Conditional class check" />
+
+ <param name="@desc@" desc="Description">
+ <param-value name="@name@" />
+ <text> is empty</text>
+ </param>
+
+
+ <warning>deprecated; use _assert-nonzero_ instead.</warning>
+
+ <t:assert-nonzero name="@name@" when="@when@" class="@class@"
+ desc="@desc@">
+ <param-copy name="@values@" />
+ </t:assert-nonzero>
+ </template>
</section>
</package>