Changes

Jump to navigation Jump to search
85 bytes added ,  15:33, 27 February 2020
no edit summary
|
* The following test does will be successful, as it does nothing (and, hence, nothing wrong):
<pre classsyntaxhighlight lang="brush:xquery">
declare %unit:test function local:void() { () };
</presyntaxhighlight>
* The following test will be successful, as the function body will raise <code>err:XPTY0004</code>:
<pre classsyntaxhighlight lang="brush:xquery">
declare %unit:test('expected', "err:XPTY0004") function local:add() {
123 + 'strings and integers cannot be added'
};
</presyntaxhighlight>
|}
|
* The first function will be evaluated before the actual test:
<pre classsyntaxhighlight lang="brush:xquery">
declare %updating %unit:before("local:check") function local:before-check() {
db:create('test-db')
unit:assert(db:exists('test-db'))
};
</presyntaxhighlight>
|}
==Query==
<pre classsyntaxhighlight lang='brush:"xquery'">
module namespace test = 'http://basex.org/modules/xqunit-tests';
()
};
</presyntaxhighlight>
By running {{Code|TEST tests.xqm}}, the following report will be generated (timings may differ):
==Result==
<pre classsyntaxhighlight lang='brush:"xml'">
<testsuites time="PT0.256S">
<testsuite name="file:///C:/Users/user/Desktop/test.xqm" time="PT0.212S" tests="8" failures="4" errors="1" skipped="1">
</testsuite>
</testsuites>
</presyntaxhighlight>
=Errors=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu