Changes

Jump to navigation Jump to search
1,253 bytes removed ,  19:42, 23 May 2014
no edit summary
With {{Version|7.9}}, the module has been further stabilized and better integrated in the BaseX GUI.
 
=Usage=
 
Since {{Version|7.9}}, a new [[Commands#TEST|TEST]] command is available, which runs all XQUnit tests in a given file or directory. All tested functions are now allowed to perform updates.
A test report is generated and returned, which resembles the format returned by other xUnit testing frameworks, such as the Maven Surefire Plugin.
=Conventions=
| '''Errors'''
|{{Error|UNIT0001|#Errors}} default error raised by this function.
|}
 
==unit:test==
 
{{Mark|Updated with Version 7.8:}} enhanced test report output
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|unit:test||element(testsuite)*}}<br />{{Func|unit:test|$functions as function(*)*|element(testsuite)*}}<br />
|-
| '''Summary'''
|Runs all functions, or the specified {{Code|$functions}}, in the current query context that have {{Code|unit}} annotations.<br />A test report is generated and returned, which resembles the format returned by other xUnit testing frameworks, such as the Maven Surefire Plugin.
|-
| '''Errors'''
|{{Error|UNIT0002|#Errors}} a test function must have no arguments.<br/>{{Error|UNIT0003|#Errors}} a test function must not be updating.<br/>{{Error|UNIT0004|#Errors}} an annotation was declared twice.<br/>{{Error|UNIT0005|#Errors}} an annotation has invalid arguments.
|-
| '''Examples'''
|{{Code|unit:test(inspect:context())}} runs all unit tests found in the query context.
|}
 
==unit:test-uris==
 
{{Mark|Updated with Version 7.8:}} enhanced test report output
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|unit:test-uris|$uris as xs:string*|element(testsuites)}}<br />
|-
| '''Summary'''
|Runs all functions in the specified modules that have {{Code|unit}} annotations.<br />A test report is generated and returned, which resembles the format returned by other xUnit testing frameworks, such as the Maven Surefire Plugin.
|-
| '''Errors'''
|{{Error|UNIT0002|#Errors}} a test function must have no arguments.<br/>{{Error|UNIT0003|#Errors}} a test function must not be updating.<br/>{{Error|UNIT0004|#Errors}} an annotation was declared twice.<br/>{{Error|UNIT0005|#Errors}} an annotation has invalid arguments.
|}
=Changelog=
=Changelog=;Version 7.9 * Added: TEST command* Removed: [[#unit:test|unit:test]], [[#unit:test-uris|unit:test-uris]]
;Version 7.8
 
* Added: [[#unit:assert-equals|unit:assert-equals]]
* Updated: enhanced test report output
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu