Skip to content

Commit 17cfa50

Browse files
committed
tidy up the tests file
1 parent 582a46e commit 17cfa50

File tree

1 file changed

+31
-11
lines changed

1 file changed

+31
-11
lines changed

test/issue-144.xsl

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
xmlns:ct="com.test"
66
version="3.0">
77

8-
<?START type declarations with NO ERRORS?>
8+
<!-- Issues Tested:
9+
1. #144 https://github.com/DeltaXML/vscode-xslt-tokenizer/issues/144 (2 'regions')
10+
2. #146 https://github.com/DeltaXML/vscode-xslt-tokenizer/issues/146
11+
3. #147 https://github.com/DeltaXML/vscode-xslt-tokenizer/issues/147
12+
4 #148 https://github.com/DeltaXML/vscode-xslt-tokenizer/issues/148
13+
-->
14+
15+
<?region 'as' attribute item types with NO ERRORS - ISSUE #144 (1/2) ?>
916
<xsl:variable name="test1" as="xs:integer" select="count(22)"/>
1017
<xsl:variable name="test2" as="map(xs:integer, map(xs:string, array(xs:integer*)))?" select="/*"/>
1118
<xsl:variable name="test3" as="xs:integer+" select="1"/>
@@ -25,7 +32,7 @@
2532
<xsl:variable name="test17" as="element(*, xs:integer)" select="//*"/>
2633
<xsl:variable name="test18" as="element(as)" select="/*"/>
2734
<xsl:variable name="new" as="function(*)" select="function() {}"/>
28-
35+
2936
<xsl:function name="fn:main" as="item()*">
3037
<!-- no missing context-item error: -->
3138
<xsl:param name="test70" as="xs:integer?"/>
@@ -37,10 +44,10 @@
3744
<xsl:variable name="XP4test2" as="union(xs:dateTime, xs:date, xs:time, xs:string)" select="/*"/>
3845
<xsl:variable name="XP4test3" as="enum('NFC', 'NFD', 'NFKC', 'NFKD')" select="/*"/>
3946
<xsl:variable name="XP4test4" as="type(ct:complex)" select="/*"/>
40-
<?END type declarations with NO ERRORS?>
47+
<?endregion 'as' attribute item types with NO ERRORS?>
4148

4249

43-
<?START type declarations WITH ERRORS?>
50+
<?region 'as' attribute item types WITH ERRORS - ISSUE #144 (2/2) ?>
4451
<xsl:variable name="test1-error" as="xs:intege" select="count(22)"/>
4552
<xsl:variable name="test1tvt-error" expand-text="yes" as="xs:intege" select="count(22)"/>
4653
<xsl:variable name="test2-error" as="arrayx(xs:string)" select="/*"/>
@@ -71,18 +78,31 @@
7178
<xsl:variable name="test29-error" as="element(?)" select="."/>
7279
<xsl:variable name="test30-error" as="element(..)?" select="."/>
7380
<xsl:variable name="test31-error" as="function()" select="function() {}"/>
74-
<xsl:variable name="test32-error" as="element()()" select="function() {}"/>
81+
<xsl:variable name="test32-error" as="element()()" select="function() {}"/>
82+
<?endregion 'as' attribute item types WITH ERRORS?>
7583

76-
77-
<?END type declarations WITH ERRORS?>
84+
<?region chained map-lookup: NO ERRORS - ISSUE #146?>
85+
<!-- there should be no linter error reported in the expression: $a?books?book -->
86+
<xsl:variable name="test1-spuriouserror" as="xs:integer"
87+
select="let $a := map { 'books': map { 'book': 1}} return $a?books?book"/>
88+
<?endregion chained map-lookup: NO ERRORS?>
89+
90+
<?region auto-complete list includes 'xs:anyAtomicType' - ISSUE #147?>
91+
<!--
92+
1. the 'xs:' in the 'as' attribute should be marked as an error
93+
2. place the cursor inside the attribute, after 'xs:'
94+
3. type the character 'a' - the auto-complete list should popup and include 'xs:anyAtomicType'
95+
4. pressing <enter> should result in the type being updated and no error should be shown for the token
96+
-->
97+
<xsl:variable name="test1-aclistincludes" as="xs:" select="1"/>
98+
<?endregion auto-complete list includes 'xs:anyAtomicType'?>
7899

79-
<?START auto-complete test?>
80-
100+
<?region auto-complete test - ISSUE #148?>
81101
<!--
82-
1. the 'as' attribute below should be marked with an error
102+
1. the 'as' attribute below should be marked with an error because it is empty
83103
2. type within the 'as' attribute, the auto-complete list should be triggered and populated properly
84104
-->
85105
<xsl:variable name="test1-autocomplate" as="" select="'a string'"/>
86-
<?END auto-complete test?>
106+
<?endregion auto-complete test?>
87107

88108
</xsl:stylesheet>

0 commit comments

Comments
 (0)