Changes

Jump to navigation Jump to search
367 bytes added ,  15:37, 6 August 2014
no edit summary
|-
| width='120' | '''Signatures'''
|{{Func|unit:assert|$test as item()*|empty-sequence()}}<br />{{Func|unit:assert|$test as item()*, $failure info as item()|empty-sequence()}}<br />
|-
| '''Summary'''
|Asserts that the effective boolean value of the specified {{Code|$test}} is true and returns an empty sequence. Otherwise, raises an error. The ''effective boolean value'' of an expression can be explicitly computed by using the {{Code|fn:boolean}} function.<br/>The default failure output can be overridden with the {{Code|$failureinfo}} argument.
|-
| '''Errors'''
|-
| width='120' | '''Signatures'''
|{{Func|unit:assert-equals|$returned as item()*, $expected as item()*|empty-sequence()}}<br />{{Func|unit:assert-equals|$returned as item()*, $expected as item()*, $failure info as item()|empty-sequence()}}<br />
|-
| '''Summary'''
|Asserts that the specified arguments are equal according to the rules of the {{Code|fn:deep-equals}} function. Otherwise, raises an error.<br/>The default failure output can be overridden with the {{Code|$failureinfo}} argument.
|-
| '''Errors'''
==unit:fail==
 
{{Mark|Updated with Version 8.0}}: 0-argument signature adeded.
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|unit:fail||empty-sequence()}}<br />{{Func|unit:fail|$failure info as item()|empty-sequence()}}<br />
|-
| '''Summary'''
|Raises a unit error with the specified an optional failure item.
|-
| '''Errors'''
<pre class='brush:xml'>
<testsuites time="PT0.084S256S"> <testsuite name="file:///C:/Users/user/Desktop/xtest.xqxqm" time="PT0.079S212S" tests="8" failures="4" errors="1" skipped="1"> <testcase name="assert-success" time="PT0.009S016S"/> <testcase name="assert-failure" time="PT0.004S005S"> <failure line="30" column="15"> <info>Empty sequence.</info> </failure>
</testcase>
<testcase name="assert-equals-failure" time="PT0.005S006S">
<failure line="35" column="22">
<returned item="1" type="xs:integer">9</returned>
<expected item="1" type="xs:integer">6</expected>
<info>Item 1: 6 expected, 9 returned.</info>
</failure>
</testcase>
<testcase name="unexpected-success" time="PT0.005S006S">
<failure>
<expected>FORG0001</expected>
</failure>
</testcase>
<testcase name="expected-failure" time="PT0.027S004S"/> <testcase name="failure" time="PT0.003S004S"> <failure line="50" column="13"> <info>Failure!</info> </failure>
</testcase>
<testcase name="error" time="PT0.003S004S"> <error line="55" column="6" type="FORG0001">Invalid <info>Cannot cast to xs:double cast: "".</info> </error>
</testcase>
<testcase name="skipped" skipped="Skipped!" time="PT0S"/>
;Version 8.0
* Added: [[#unit:fail|unit:fail]], 0-argument signature.* Updated: the failure info argument of functions can now be an arbitrary item.* Updated: infos are now represented in an <code>info</code> child element.
;Version 7.9
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu