forked from xspec/xspec
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/xspec/xspec into fix_issue-67
* 'master' of git://github.com/xspec/xspec: Separate common tests (for XSLT and XQuery) from generate-tests-utils.xspec (only for XSLT) (#83) Make XProc testing command lines more portable (xspec#98) Update Saxon versions (xspec#116) Display result.log on test failure (xspec#110) # Conflicts: # test/generate-tests-utils.xspec
- Loading branch information
Showing
7 changed files
with
164 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- ===================================================================== --> | ||
<!-- File: test/generate-x-utils.xspec --> | ||
<!-- Author: Florent Georges --> | ||
<!-- Tags: --> | ||
<!-- Copyright (c) 2010 Jeni Tennsion (see end of file.) --> | ||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | ||
<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
xmlns:test="http://www.jenitennison.com/xslt/unit-test" | ||
query="http://www.jenitennison.com/xslt/unit-test" | ||
query-at="../src/compiler/generate-query-utils.xql" | ||
stylesheet="../src/compiler/generate-tests-utils.xsl"> | ||
|
||
<!-- | ||
Test the source files generate-tests-utils.xsl and generate-query-utils.xql. | ||
--> | ||
|
||
<!-- | ||
Function test:deep-equal($seq1, $seq2). | ||
--> | ||
<t:scenario label="test:deep-equal($seq1, $seq2)"> | ||
|
||
<t:scenario label="Identical Sequences"> | ||
<t:call function="test:deep-equal"> | ||
<t:param select="1, 2"/> | ||
<t:param select="1, 2"/> | ||
</t:call> | ||
<t:expect label="the result" test="$x:result eq true()"/> | ||
</t:scenario> | ||
|
||
<t:scenario label="Non-Identical Sequences"> | ||
<t:call function="test:deep-equal"> | ||
<t:param select="1, 2"/> | ||
<t:param select="1, 3"/> | ||
</t:call> | ||
<t:expect label="the result" test="$x:result eq false()"/> | ||
</t:scenario> | ||
|
||
<t:scenario label="Sequences with Same Items in Different Orders"> | ||
<t:call function="test:deep-equal"> | ||
<t:param select="1, 2"/> | ||
<t:param select="2, 1"/> | ||
</t:call> | ||
<t:expect label="the result" test="$x:result eq false()"/> | ||
</t:scenario> | ||
|
||
<t:scenario label="Empty Sequences"> | ||
<t:call function="test:deep-equal"> | ||
<t:param select="()"/> | ||
<t:param select="()"/> | ||
</t:call> | ||
<t:expect label="the result" test="$x:result eq true()"/> | ||
</t:scenario> | ||
|
||
<t:scenario label="One empty sequence"> | ||
<t:call function="test:deep-equal"> | ||
<t:param select="()"/> | ||
<t:param select="1"/> | ||
</t:call> | ||
<t:expect label="the result" test="$x:result eq false()"/> | ||
</t:scenario> | ||
|
||
<t:scenario label="A text node and several text nodes"> | ||
<t:variable name="elems" as="element()+"> | ||
<e>foo</e> | ||
<e>bar</e> | ||
</t:variable> | ||
<t:call function="test:deep-equal"> | ||
<t:param as="text()">foobar</t:param> | ||
<t:param select="$elems/text()"/> | ||
</t:call> | ||
<t:expect label="the result" test="$x:result eq true()"/> | ||
</t:scenario> | ||
|
||
</t:scenario> | ||
|
||
<!-- | ||
Function test:node-deep-equal($seq1, $seq2). | ||
--> | ||
<t:scenario label="test:node-deep-equal($seq1, $seq2)"> | ||
|
||
<t:scenario label="Identical Element Sequences"> | ||
<t:call function="test:node-deep-equal"> | ||
<t:param name="node1">foobar</t:param> | ||
<t:param name="node2">foobar</t:param> | ||
</t:call> | ||
<t:expect label="the result" test="$x:result eq true()"/> | ||
</t:scenario> | ||
|
||
</t:scenario> | ||
|
||
<!-- | ||
Function test:report-atomic-value | ||
--> | ||
<t:scenario label="test:report-atomic-value"> | ||
|
||
<t:scenario label="Copy of https://github.com/xspec/xspec/blob/8931b371bd619feeeee25bd7014d8a677ab88505/src/compiler/generate-tests-utils.xsl#L622-L629"> | ||
<t:scenario label="String Containing Single Quotes"> | ||
<t:call function="test:report-atomic-value"> | ||
<t:param select="'don''t'" /> | ||
</t:call> | ||
<t:expect label="Escaped" select="'''don''''t'''" /> | ||
</t:scenario> | ||
</t:scenario> | ||
|
||
</t:scenario> | ||
|
||
</t:description> | ||
|
||
|
||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | ||
<!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. --> | ||
<!-- --> | ||
<!-- Copyright (c) 2010 Jeni Tennsion --> | ||
<!-- --> | ||
<!-- The contents of this file are subject to the MIT License (see the URI --> | ||
<!-- http://www.opensource.org/licenses/mit-license.php for details). --> | ||
<!-- --> | ||
<!-- Permission is hereby granted, free of charge, to any person obtaining --> | ||
<!-- a copy of this software and associated documentation files (the --> | ||
<!-- "Software"), to deal in the Software without restriction, including --> | ||
<!-- without limitation the rights to use, copy, modify, merge, publish, --> | ||
<!-- distribute, sublicense, and/or sell copies of the Software, and to --> | ||
<!-- permit persons to whom the Software is furnished to do so, subject to --> | ||
<!-- the following conditions: --> | ||
<!-- --> | ||
<!-- The above copyright notice and this permission notice shall be --> | ||
<!-- included in all copies or substantial portions of the Software. --> | ||
<!-- --> | ||
<!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, --> | ||
<!-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --> | ||
<!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.--> | ||
<!-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY --> | ||
<!-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, --> | ||
<!-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE --> | ||
<!-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> | ||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters