30
30
import static org .exist .test .XQueryAssertions .*;
31
31
32
32
/**
33
- * Ensure function types returned in element content throws at compile time and has location information
34
- * https://github.com/eXist-db/exist/issues/3474
33
+ * Ensure function types returned in element content throws at compile time and
34
+ * has location information.
35
+ * See issue :<a href="https://github.com/eXist-db/exist/issues/3474">#3474</a>.
35
36
*
36
37
* @author <a href="mailto:[email protected] ">Juri Leino</a>
37
38
*/
@@ -43,7 +44,7 @@ public void arrayLiteral() throws EXistException, PermissionDeniedException {
43
44
assertXQResultSimilar (elemSource ("<test/>" ), executeQuery (query ));
44
45
}
45
46
46
- // TODO: array content could be removed after https://github.com/eXist-db/exist/issues/3472 is fixed
47
+ // TODO(JL) : array content could be removed after https://github.com/eXist-db/exist/issues/3472 is fixed
47
48
@ Test
48
49
public void arrayConstructor () throws EXistException , PermissionDeniedException {
49
50
final String query = "element test { array { () } }" ;
@@ -63,23 +64,23 @@ public void partialBuiltIn() throws EXistException, PermissionDeniedException {
63
64
assertXQStaticError (ErrorCodes .XQTY0105 , 1 , 16 , error , compileQuery (query ));
64
65
}
65
66
66
- // TODO: Does still throw without location info
67
+ // TODO(JL) : Does still throw without location info
67
68
@ Test
68
69
public void functionReference () throws EXistException , PermissionDeniedException {
69
70
final String query = "element test { sum#0 }" ;
70
71
final String error = "Function types are not allowed in element content. Got function(*)" ;
71
72
assertXQStaticError (ErrorCodes .XQTY0105 , 0 , 0 , error , compileQuery (query ));
72
73
}
73
74
74
- // TODO: Does not throw at compile time
75
+ // TODO(JL) : Does not throw at compile time
75
76
@ Test
76
77
public void functionVariable () throws EXistException , PermissionDeniedException {
77
78
final String query = "let $f := function () {} return element test { $f }" ;
78
79
final String error = "Enclosed expression contains function item" ;
79
80
assertXQDynamicError (ErrorCodes .XQTY0105 , 1 , 49 , error , executeQuery (query ));
80
81
}
81
82
82
- // TODO: user defined function has its location offset to a weird location
83
+ // TODO(JL) : user defined function has its location offset to a weird location
83
84
@ Test
84
85
public void userDefinedFunction () throws EXistException , PermissionDeniedException {
85
86
final String query = "element test { function () {} }" ;
@@ -110,29 +111,29 @@ public void sequenceOfMaps() throws EXistException, PermissionDeniedException {
110
111
assertXQDynamicError (ErrorCodes .XQTY0105 , 0 , 0 , error , executeQuery (query ));
111
112
}
112
113
114
+ // TODO(JL): add (sub-expression) location
113
115
/**
114
116
* This is an edge case, which would evaluate to empty sequence
115
117
* but should arguably still throw.
116
118
*/
117
- // TODO: add (sub-expression) location
118
119
@ Test
119
120
public void sequenceOfMapsEdgeCase () throws EXistException , PermissionDeniedException {
120
121
final String query = "element test { (map {})[2] }" ;
121
122
final String error = "Function types are not allowed in element content. Got map(*)" ;
122
123
assertXQStaticError (ErrorCodes .XQTY0105 , 0 , 0 , error , compileQuery (query ));
123
124
}
124
125
125
- // TODO: add (sub-expression) location
126
- // TODO: this could throw at compile time
126
+ // TODO(JL) : add (sub-expression) location
127
+ // TODO(JL) : this could throw at compile time
127
128
@ Test
128
129
public void arrayOfMaps () throws EXistException , PermissionDeniedException {
129
130
final String query = "element test { [map {}] }" ;
130
131
final String error = "Enclosed expression contains function item" ;
131
132
assertXQDynamicError (ErrorCodes .XQTY0105 , 1 , 16 , error , executeQuery (query ));
132
133
};
133
134
134
- // TODO: add (sub-expression) location
135
- // TODO: This should throw at compile time, but does not
135
+ // TODO(JL) : add (sub-expression) location
136
+ // TODO(JL) : This should throw at compile time, but does not
136
137
@ Test
137
138
public void mapConstructorInSubExpression () throws EXistException , PermissionDeniedException {
138
139
final String query = "element test { \" a\" , map {} }" ;
0 commit comments