You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got function(*) [at line 1, column 16, source: element test { sum#0 }]";
finalStringquery = "let $f := function () { () } return element test { $f }";
89
+
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got function(*) [at line 1, column 16, source: element test { sum(?) }]";
90
+
assertCompilationError(query, error);
91
+
}
92
+
93
+
/**
94
+
* TODO: remove empty sequence after https://github.com/eXist-db/exist/issues/3551 is fixed
finalStringquery = "element test { function () { () } }";
@@ -74,28 +108,52 @@ public void mapConstructor() throws XMLDBException {
74
108
assertCompilationError(query, error);
75
109
}
76
110
77
-
// -- no error is thrown at compile time
78
-
// @Test
79
-
// public void mapConstructorInSequence() throws XMLDBException {
80
-
// final String query = "element test {\n" +
81
-
// " \"a\",\n" +
82
-
// " map {}\n" +
83
-
// "}";
84
-
// final String error = "err:XQTY0105 Function types are not allowed in element content. Got map(*) [at line 1, column 14, source: element test { map {} }]";
85
-
// assertCompilationError(query, error);
86
-
// }
87
-
88
-
89
-
// -- no error is thrown at compile time nor run time
90
-
// @Test
91
-
// public void arrayInSequence() throws XMLDBException {
92
-
// final String query = "element test {\n" +
93
-
// " \"a\",\n" +
94
-
// " []\n" +
95
-
// "}";
96
-
// final String error = "err:XQTY0105 Function types are not allowed in element content. Got map(*) [at line 1, column 14, source: element test { map {} }]";
97
-
// assertCompilationError(query, error);
98
-
// }
111
+
/**
112
+
* sequence in enclosed expression with only a function type
113
+
*/
114
+
@Ignore
115
+
@Test
116
+
publicvoidsequenceOfMaps() throwsXMLDBException {
117
+
finalStringquery = "element test { (map {}) }";
118
+
finalStringerror = "An exception occurred during query execution: err:XQTY0105 Function types are not allowed in element content. Got map(*) [source: element foo { (map{}) }]";
119
+
assertCompilationError(query, error);
120
+
}
121
+
122
+
/**
123
+
* there is an edge case which would evaluate to empty sequence
finalStringquery = "element test { (map {})[2] }";
131
+
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got map(*) [source: element test { (map {})[2] }]";
132
+
assertCompilationError(query, error);
133
+
}
134
+
135
+
/**
136
+
* -- no error is thrown at compile time
137
+
* TODO: add (sub-expression) location
138
+
*/
139
+
@Test
140
+
publicvoidArrayOfMaps() throwsXMLDBException {
141
+
finalStringquery = "element test { [map {}] }";
142
+
finalStringerror = "An exception occurred during query execution: err:XQTY0105 Function types are not allowed in element content. Got map(*) [source: element test { [map{}] }]";
finalStringquery = "element test { \"a\", map {} }";
154
+
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got map(*) [at line 1, column 20, source: element test { map {} }]";
0 commit comments