Changes

Jump to navigation Jump to search
710 bytes added ,  21:56, 14 December 2013
no edit summary
<pre class='brush:xquery'>
(:~ Initializing function, which is called once before all tests. :)
declare %unit:before-module function localunit:before-all-tests() {
()
};
(:~ Initializing function, which is called once after all tests. :)
declare %unit:after-module function localunit:after-all-tests() {
()
};
(:~ Initializing function, which is called before each test. :)
declare %unit:before function localunit:before() {
()
};
(:~ Initializing function, which is called after each test. :)
declare %unit:after function localunit:after() {
()
};
(:~ Function demonstrating a successful test. :)
declare%unit:test function unit:assert-success() { unit:assert(<a/>)}; (:~ Function demonstrating a failure using unit:assert. :)declare %unit:test function localunit:successassert-functionfailure() { unit:assert(1 + 2 = 3(), 'Empty sequence.')
};
(:~ Function demonstrating a failureusing unit:assert-equals. :)declare %unit:test function localunit:assert-equals-failure-function() { unit:assert-equals(4 + 5 = , 6)
};
(:~ Function demonstrating an expected errorunexpected success. :)declare %unit:test("expected", "FORG0001") function localunit:expectedunexpected-success() {
()
};
(:~ Function demonstrating an expected errorfailure. :)declare %unit:test("expected", "FORG0001") function localunit:expected-errorfailure() {
1 + <a/>
};
(:~ Function demonstrating the creation of a failure. :)declare %unit:test function unit:failure() { unit:fail("Failure!")};
(:~ Function demonstrating an error. :)
declare %unit:test function localunit:error-function() {
1 + <a/>
};
(:~ Skipping a test. :)
declare %unit:test %unit:ignore("Skipped!") function localunit:skipped-function() {
()
};
<pre class='brush:xml'>
<testsuite name="file:/path/to/testsC:/Users/user/Desktop/x.xq" time="PT0S" tests="68" failures="24" errors="1" skipped="1"> <testcase name="assert-success-function" time="PT0S"/> <testcase name="assert-failure-function" time="PT0S"> <failure messageline="Assertion failed.28" column="15" type="UNIT0001">Empty sequence.</failure>
</testcase>
<testcase name="expectedassert-equals-successfailure" time="PT0S"> <failure messageline="33" column="Error 22"> <returned item="1">9</returned> <expected." typeitem="FORG00011">6</expected> </failure>
</testcase>
<testcase name="expectedunexpected-errorsuccess" time="PT0S"/> <failure> <expected>FORG0001<testcase name="error-function" time="PT0S"/expected> <error message="Invalid xs:double cast: ." type="FORG0001"/failure>
</testcase>
<testcase name="skippedexpected-functionfailure" time="PT0S"/> <testcase name="failure" time="PT0S"> <skipped messagefailure line="48" column="Skipped13" type="UNIT0001">Failure!"</failure>
</testcase>
<testcase name="error" time="PT0S">
<error line="53" column="6" type="FORG0001">Invalid xs:double cast: .</error>
</testcase>
<testcase name="skipped" skipped="Skipped!" time="PT0S"/>
</testsuite>
</pre>
=Changelog=
 
=Changelog=
 
;Version 7.8
* Added: [[#db:assert-equals|db:assert-equals]]
* Updated: schema of testsuite report
This module was introduced with Version 7.7.
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu