datetime: Assert on non-empty timestamp_current

This won't be a problem in practice if nothing imports the
package, so existing systems won't be affected.

* datetime.xml: New assertion for timestamp_current.
master
Mike Gerwitz 2018-04-06 11:05:27 -04:00
parent 247ade8f1a
commit 1254141c0f
1 changed files with 12 additions and 3 deletions

View File

@ -18,12 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<package xmlns="http://www.lovullo.com/rater"
xmlns:c="http://www.lovullo.com/calc"
core="true"
desc="Date and time">
xmlns:t="http://www.lovullo.com/rater/apply-template"
xmlns:c="http://www.lovullo.com/calc"
core="true"
desc="Date and time">
<import package="base" />
<import package="assert" />
<import package="vector/cmatch" />
Providing the current timestamp externally allows the system to be
wholly deterministic.
@ -35,6 +39,11 @@
desc="Unix timestamp representing the current time of the
system (clock time), as it should be perceived" />
<t:assert failure="Missing Unix timestamp for timestamp_current">
<t:match-gt on="timestamp_current" value="ZERO" />
</t:assert>
This system does not handle its own arthiemtic to figure out the
current date components from the given timestamp.