Jump to navigation Jump to search
56 bytes added ,  13:39, 5 June 2015
Fix typo, make minor language improvements, and add link to deep-equal function
The more complex a software application grows, the more error-prone it gets. This is why testing frameworks have been developed, which provide a standardized, automatized automated way for of testing software. The [ XUnit] frameworks (such as SUnit or JUnit) allow testing of atomic unit units of a program, such as single functions and algorithms.
This module borrows heavily from the existing frameworks: it provides various annotations for testing XQuery functions. Unit functions are provided to assert the validity of arbitrary conditions expressed in XQuery and to raise errors whenever a condition is not satisfied. Some additional functions exist to run all unit tests of the current module or a set of specified library modules.
<pre class="brush:xquery">
declare %unit:test('expected', "err:XPTY0004") function local:add() {
123 + 'strings and integers cannot to be added'
| '''Summary'''
|Asserts that the specified arguments are equal according to the rules of the [ {{Code|fn:deep-equalsequal}} function]. Otherwise, raises an error.<br/>The default failure message can be overridden with the {{Code|$info}} argument.
| '''Errors'''
administrator, editor


Navigation menu