Changes

Jump to navigation Jump to search
1,511 bytes added ,  17:37, 8 March 2013
|{{Error|XQUNIT0003|#Errors}} a test function must have no arguments.<br/>{{Error|XQUNIT0004|#Errors}} a test function must not be updating.<br/>{{Error|XQUNIT0005|#Errors}} an annotation was declared twice.<br/>{{Error|XQUNIT0006|#Errors}} an annotation has invalid arguments.
|}
 
=Examples=
 
The following XQuery main module contains all available XQUnit annotations:
 
<pre class='brush:xquery'>
(:~ Initializing function, which is called once before all tests. :)
declare
%xqunit:before-module
function xqunit:before-all-tests() { ()
};
 
(:~ Initializing function, which is called once after all tests. :)
declare
%xqunit:after-module
function local:after-all-tests() { ()
};
 
(:~ Initializing function, which is called before each test. :)
declare
%xqunit:before
function local:before() { ()
};
 
(:~ Initializing function, which is called after each test. :)
declare
%xqunit:after
function local:after() { ()
};
 
(:~ Function demonstrating a successful test. :)
declare
%xqunit:test
function local:success-function() {
xqunit:assert(1 + 2 = 3)
};
 
(:~ Function demonstrating a failure. :)
declare
%xqunit:test
function local:failure-function() {
xqunit:assert(4 + 5 = 6)
};
 
(:~ Function demonstrating an expected error. :)
declare
%xqunit:test("expected", "FORG0001")
function local:expected-success() {
()
};
 
(:~ Function demonstrating an expected error. :)
declare
%xqunit:test("expected", "FORG0001")
function local:expected-error() {
1 + <a/>
};
 
(:~ Function demonstrating an error. :)
declare
%xqunit:test
function local:error-function() {
1 + <a/>
};
 
(:~ Skipping a test. :)
declare
%xqunit:test %xqunit:ignore("Skipped!")
function local:skipped-function() {
()
};
 
(: run all tests :)
xqunit:test()
</pre>
 
==xqunit:assert==
=Errors=
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu