|
* The following test does will be successful, as it does nothing (and, hence, nothing wrong):
<syntaxhighlight pre lang="'xquery"'>
declare %unit:test function local:void() { () };
</pre>
* The following test will be successful, as the function body will raise <code>err:XPTY0004</code>:
<syntaxhighlight pre lang="'xquery"'>
declare %unit:test('expected', "err:XPTY0004") function local:add() {
123 + 'strings and integers cannot be added'
|
* The first function will be evaluated before the actual test:
<syntaxhighlight pre lang="'xquery"'>
declare %updating %unit:before("local:check") function local:before-check() {
db:create('test-db')
==Query==
<syntaxhighlight pre lang="'xquery"'>
module namespace test = 'http://basex.org/modules/xqunit-tests';