Changes

Jump to navigation Jump to search
56 bytes added ,  13:39, 5 June 2015
m
Fix typo, make minor language improvements, and add link to deep-equal function
=Introduction=
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 [http://en.wikipedia.org/wiki/XUnit 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'
};
</pre>
|-
| '''Summary'''
|Asserts that the specified arguments are equal according to the rules of the [http://www.w3.org/TR/xpath-functions-30/#func-deep-equal {{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
43

edits

Navigation menu