294
|
1 |
"{ Package: 'stx:goodies/xmlsuite/xquery' }"
|
|
2 |
|
|
3 |
"{ NameSpace: XQuery }"
|
|
4 |
|
|
5 |
XQTSTestCase subclass:#XQTSAllString
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'XQuery-Tests-XQTS'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!XQTSAllString methodsFor:'tests'!
|
|
14 |
|
|
15 |
test_K2_EndsWithFunc_1
|
|
16 |
|
|
17 |
| query result |
|
|
18 |
|
|
19 |
query := '
|
|
20 |
(:*******************************************************:)
|
|
21 |
(: Test: K2-EndsWithFunc-1 :)
|
|
22 |
(: Written by: Frans Englich :)
|
|
23 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
24 |
(: Purpose: Compare two values returned from fn:lower-case(). :)
|
|
25 |
(:*******************************************************:)
|
|
26 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
27 |
declare variable $vB as xs:string := ("b string", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
28 |
ends-with(lower-case($vA), lower-case($vB))
|
|
29 |
'.
|
|
30 |
|
|
31 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
32 |
|
|
33 |
|
|
34 |
result := interpreter evaluate: query.
|
|
35 |
self
|
|
36 |
assert: (self xqtsResultTextFromResult: result)
|
|
37 |
= (self xqtsResultTextFromFile:
|
|
38 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K2-EndsWithFunc-1.txt')
|
|
39 |
|
|
40 |
"Created: / 11-05-2013 / 19:17:54 / jirka"
|
|
41 |
!
|
|
42 |
|
|
43 |
test_K2_EndsWithFunc_10
|
|
44 |
|
|
45 |
| query result |
|
|
46 |
|
|
47 |
query := '
|
|
48 |
(:*******************************************************:)
|
|
49 |
(: Test: K-EndsWithFunc-10 :)
|
|
50 |
(: Written by: Frans Englich :)
|
|
51 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
52 |
(: Purpose: A test whose essence is: `not(ends-with ((), "a string"))`. :)
|
|
53 |
(:*******************************************************:)
|
|
54 |
not(ends-with ((), "a string"))
|
|
55 |
'.
|
|
56 |
|
|
57 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
58 |
|
|
59 |
|
|
60 |
result := interpreter evaluate: query.
|
|
61 |
self
|
|
62 |
assert: (self xqtsResultTextFromResult: result)
|
|
63 |
= (self xqtsResultTextFromFile:
|
|
64 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K2-EndsWithFunc-10.txt')
|
|
65 |
|
|
66 |
"Created: / 11-05-2013 / 22:49:19 / houzvjir@fel.cvut.cz"
|
|
67 |
!
|
|
68 |
|
|
69 |
test_K2_EndsWithFunc_2
|
|
70 |
|
|
71 |
| query result |
|
|
72 |
|
|
73 |
query := '
|
|
74 |
(:*******************************************************:)
|
|
75 |
(: Test: K2-EndsWithFunc-2 :)
|
|
76 |
(: Written by: Frans Englich :)
|
|
77 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
78 |
(: Purpose: Compare two values returned from fn:upper-case(). :)
|
|
79 |
(:*******************************************************:)
|
|
80 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
81 |
declare variable $vB as xs:string := ("b string", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
82 |
ends-with(upper-case($vA), upper-case($vB))
|
|
83 |
'.
|
|
84 |
|
|
85 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
86 |
|
|
87 |
|
|
88 |
result := interpreter evaluate: query.
|
|
89 |
self
|
|
90 |
assert: (self xqtsResultTextFromResult: result)
|
|
91 |
= (self xqtsResultTextFromFile:
|
|
92 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K2-EndsWithFunc-2.txt')
|
|
93 |
|
|
94 |
"Created: / 11-05-2013 / 19:18:29 / jirka"
|
|
95 |
!
|
|
96 |
|
|
97 |
test_K2_EndsWithFunc_3
|
|
98 |
|
|
99 |
| query result |
|
|
100 |
|
|
101 |
query := '
|
|
102 |
(:*******************************************************:)
|
|
103 |
(: Test: K2-EndsWithFunc-3 :)
|
|
104 |
(: Written by: Frans Englich :)
|
|
105 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
106 |
(: Purpose: Compare two non-matching values returned from fn:lower-case(). :)
|
|
107 |
(:*******************************************************:)
|
|
108 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
109 |
declare variable $vB as xs:string := ("no match", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
110 |
ends-with(lower-case($vA), lower-case($vB))
|
|
111 |
'.
|
|
112 |
|
|
113 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
114 |
|
|
115 |
|
|
116 |
result := interpreter evaluate: query.
|
|
117 |
self
|
|
118 |
assert: (self xqtsResultTextFromResult: result)
|
|
119 |
= (self xqtsResultTextFromFile:
|
|
120 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K2-EndsWithFunc-3.txt')
|
|
121 |
|
|
122 |
"Created: / 11-05-2013 / 19:18:41 / jirka"
|
|
123 |
!
|
|
124 |
|
|
125 |
test_K2_EndsWithFunc_4
|
|
126 |
|
|
127 |
| query result |
|
|
128 |
|
|
129 |
query := '
|
|
130 |
(:*******************************************************:)
|
|
131 |
(: Test: K2-EndsWithFunc-4 :)
|
|
132 |
(: Written by: Frans Englich :)
|
|
133 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
134 |
(: Purpose: Compare two non-matching values returned from fn:upper-case(). :)
|
|
135 |
(:*******************************************************:)
|
|
136 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
137 |
declare variable $vB as xs:string := ("no match", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
138 |
ends-with(upper-case($vA), upper-case($vB))
|
|
139 |
'.
|
|
140 |
|
|
141 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
142 |
|
|
143 |
|
|
144 |
result := interpreter evaluate: query.
|
|
145 |
self
|
|
146 |
assert: (self xqtsResultTextFromResult: result)
|
|
147 |
= (self xqtsResultTextFromFile:
|
|
148 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K2-EndsWithFunc-4.txt')
|
|
149 |
|
|
150 |
"Created: / 11-05-2013 / 19:18:53 / jirka"
|
|
151 |
!
|
|
152 |
|
|
153 |
test_K2_EndsWithFunc_5
|
|
154 |
|
|
155 |
| query result |
|
|
156 |
|
|
157 |
query := '
|
|
158 |
(:*******************************************************:)
|
|
159 |
(: Test: K2-EndsWithFunc-5 :)
|
|
160 |
(: Written by: Frans Englich :)
|
|
161 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
162 |
(: Purpose: Compare two non-matching values returned from fn:lower-case() and fn:upper-case(). :)
|
|
163 |
(:*******************************************************:)
|
|
164 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
165 |
declare variable $vB as xs:string := ("b string", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
166 |
ends-with(upper-case($vA), lower-case($vB))
|
|
167 |
'.
|
|
168 |
|
|
169 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
170 |
|
|
171 |
|
|
172 |
result := interpreter evaluate: query.
|
|
173 |
self
|
|
174 |
assert: (self xqtsResultTextFromResult: result)
|
|
175 |
= (self xqtsResultTextFromFile:
|
|
176 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K2-EndsWithFunc-5.txt')
|
|
177 |
|
|
178 |
"Created: / 11-05-2013 / 19:19:03 / jirka"
|
|
179 |
!
|
|
180 |
|
|
181 |
test_K2_EndsWithFunc_6
|
|
182 |
|
|
183 |
| query result |
|
|
184 |
|
|
185 |
query := '
|
|
186 |
(:*******************************************************:)
|
|
187 |
(: Test: K2-EndsWithFunc-6 :)
|
|
188 |
(: Written by: Frans Englich :)
|
|
189 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
190 |
(: Purpose: Compare two non-matching values returned from fn:lower-case() and fn:upper-case(). :)
|
|
191 |
(:*******************************************************:)
|
|
192 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
193 |
declare variable $vB as xs:string := ("b string", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
194 |
ends-with(lower-case($vA), upper-case($vB))
|
|
195 |
'.
|
|
196 |
|
|
197 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
198 |
|
|
199 |
|
|
200 |
result := interpreter evaluate: query.
|
|
201 |
self
|
|
202 |
assert: (self xqtsResultTextFromResult: result)
|
|
203 |
= (self xqtsResultTextFromFile:
|
|
204 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K2-EndsWithFunc-6.txt')
|
|
205 |
|
|
206 |
"Created: / 11-05-2013 / 19:19:31 / jirka"
|
|
207 |
!
|
|
208 |
|
|
209 |
test_K2_EndsWithFunc_7
|
|
210 |
|
|
211 |
| query result |
|
|
212 |
|
|
213 |
query := '
|
|
214 |
(:*******************************************************:)
|
|
215 |
(: Test: K-EndsWithFunc-7 :)
|
|
216 |
(: Written by: Frans Englich :)
|
|
217 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
218 |
(: Purpose: A test whose essence is: `not(ends-with("tattoo", "atto"))`. :)
|
|
219 |
(:*******************************************************:)
|
|
220 |
not(ends-with("tattoo", "atto"))
|
|
221 |
'.
|
|
222 |
|
|
223 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
224 |
|
|
225 |
|
|
226 |
result := interpreter evaluate: query.
|
|
227 |
self
|
|
228 |
assert: (self xqtsResultTextFromResult: result)
|
|
229 |
= (self xqtsResultTextFromFile:
|
|
230 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K2-EndsWithFunc-7.txt')
|
|
231 |
|
|
232 |
"Created: / 11-05-2013 / 22:47:55 / houzvjir@fel.cvut.cz"
|
|
233 |
!
|
|
234 |
|
|
235 |
test_K2_EndsWithFunc_8
|
|
236 |
|
|
237 |
| query result |
|
|
238 |
|
|
239 |
query := '
|
|
240 |
(:*******************************************************:)
|
|
241 |
(: Test: K-EndsWithFunc-8 :)
|
|
242 |
(: Written by: Frans Englich :)
|
|
243 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
244 |
(: Purpose: A test whose essence is: `not(ends-with("tattoo", "atto"))`. :)
|
|
245 |
(:*******************************************************:)
|
|
246 |
not(ends-with("tattoo", "atto"))
|
|
247 |
'.
|
|
248 |
|
|
249 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
250 |
|
|
251 |
|
|
252 |
result := interpreter evaluate: query.
|
|
253 |
self
|
|
254 |
assert: (self xqtsResultTextFromResult: result)
|
|
255 |
= (self xqtsResultTextFromFile:
|
|
256 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K2-EndsWithFunc-8.txt')
|
|
257 |
|
|
258 |
"Created: / 11-05-2013 / 22:48:21 / houzvjir@fel.cvut.cz"
|
|
259 |
!
|
|
260 |
|
|
261 |
test_K2_EndsWithFunc_9
|
|
262 |
|
|
263 |
| query result |
|
|
264 |
|
|
265 |
query := '
|
|
266 |
(:*******************************************************:)
|
|
267 |
(: Test: K-EndsWithFunc-9 :)
|
|
268 |
(: Written by: Frans Englich :)
|
|
269 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
270 |
(: Purpose: A test whose essence is: `ends-with((), ())`. :)
|
|
271 |
(:*******************************************************:)
|
|
272 |
ends-with((), ())
|
|
273 |
'.
|
|
274 |
|
|
275 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
276 |
|
|
277 |
|
|
278 |
result := interpreter evaluate: query.
|
|
279 |
self
|
|
280 |
assert: (self xqtsResultTextFromResult: result)
|
|
281 |
= (self xqtsResultTextFromFile:
|
|
282 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K2-EndsWithFunc-9.txt')
|
|
283 |
|
|
284 |
"Created: / 11-05-2013 / 22:48:53 / houzvjir@fel.cvut.cz"
|
|
285 |
!
|
|
286 |
|
|
287 |
test_K2_StartsWithFunc_1
|
|
288 |
|
|
289 |
| query result |
|
|
290 |
|
|
291 |
query := '
|
|
292 |
(:*******************************************************:)
|
|
293 |
(: Test: K2-StartsWithFunc-1 :)
|
|
294 |
(: Written by: Frans Englich :)
|
|
295 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
296 |
(: Purpose: Compare two values returned from fn:lower-case(). :)
|
|
297 |
(:*******************************************************:)
|
|
298 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
299 |
declare variable $vB as xs:string := ("b string", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
300 |
starts-with(lower-case($vA), lower-case($vB))
|
|
301 |
'.
|
|
302 |
|
|
303 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
304 |
|
|
305 |
|
|
306 |
result := interpreter evaluate: query.
|
|
307 |
self
|
|
308 |
assert: (self xqtsResultTextFromResult: result)
|
|
309 |
= (self xqtsResultTextFromFile:
|
|
310 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K2-StartsWithFunc-1.txt')
|
|
311 |
|
|
312 |
"Created: / 11-05-2013 / 23:04:18 / houzvjir@fel.cvut.cz"
|
|
313 |
!
|
|
314 |
|
|
315 |
test_K2_StartsWithFunc_2
|
|
316 |
|
|
317 |
| query result |
|
|
318 |
|
|
319 |
query := '
|
|
320 |
(:*******************************************************:)
|
|
321 |
(: Test: K2-StartsWithFunc-2 :)
|
|
322 |
(: Written by: Frans Englich :)
|
|
323 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
324 |
(: Purpose: Compare two values returned from fn:upper-case(). :)
|
|
325 |
(:*******************************************************:)
|
|
326 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
327 |
declare variable $vB as xs:string := ("b string", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
328 |
starts-with(upper-case($vA), upper-case($vB))
|
|
329 |
'.
|
|
330 |
|
|
331 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
332 |
|
|
333 |
|
|
334 |
result := interpreter evaluate: query.
|
|
335 |
self
|
|
336 |
assert: (self xqtsResultTextFromResult: result)
|
|
337 |
= (self xqtsResultTextFromFile:
|
|
338 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K2-StartsWithFunc-2.txt')
|
|
339 |
|
|
340 |
"Created: / 11-05-2013 / 23:05:02 / houzvjir@fel.cvut.cz"
|
|
341 |
!
|
|
342 |
|
|
343 |
test_K2_StartsWithFunc_3
|
|
344 |
|
|
345 |
| query result |
|
|
346 |
|
|
347 |
query := '
|
|
348 |
(:*******************************************************:)
|
|
349 |
(: Test: K2-StartsWithFunc-3 :)
|
|
350 |
(: Written by: Frans Englich :)
|
|
351 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
352 |
(: Purpose: Compare two non-matching values returned from fn:lower-case(). :)
|
|
353 |
(:*******************************************************:)
|
|
354 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
355 |
declare variable $vB as xs:string := ("no match", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
356 |
starts-with(lower-case($vA), lower-case($vB))
|
|
357 |
'.
|
|
358 |
|
|
359 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
360 |
|
|
361 |
|
|
362 |
result := interpreter evaluate: query.
|
|
363 |
self
|
|
364 |
assert: (self xqtsResultTextFromResult: result)
|
|
365 |
= (self xqtsResultTextFromFile:
|
|
366 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K2-StartsWithFunc-3.txt')
|
|
367 |
|
|
368 |
"Created: / 11-05-2013 / 23:05:31 / houzvjir@fel.cvut.cz"
|
|
369 |
!
|
|
370 |
|
|
371 |
test_K2_StartsWithFunc_4
|
|
372 |
|
|
373 |
| query result |
|
|
374 |
|
|
375 |
query := '
|
|
376 |
(:*******************************************************:)
|
|
377 |
(: Test: K2-StartsWithFunc-4 :)
|
|
378 |
(: Written by: Frans Englich :)
|
|
379 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
380 |
(: Purpose: Compare two non-matching values returned from fn:upper-case(). :)
|
|
381 |
(:*******************************************************:)
|
|
382 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
383 |
declare variable $vB as xs:string := ("no match", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
384 |
starts-with(upper-case($vA), upper-case($vB))
|
|
385 |
'.
|
|
386 |
|
|
387 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
388 |
|
|
389 |
|
|
390 |
result := interpreter evaluate: query.
|
|
391 |
self
|
|
392 |
assert: (self xqtsResultTextFromResult: result)
|
|
393 |
= (self xqtsResultTextFromFile:
|
|
394 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K2-StartsWithFunc-4.txt')
|
|
395 |
|
|
396 |
"Created: / 11-05-2013 / 23:05:57 / houzvjir@fel.cvut.cz"
|
|
397 |
!
|
|
398 |
|
|
399 |
test_K2_StartsWithFunc_5
|
|
400 |
|
|
401 |
| query result |
|
|
402 |
|
|
403 |
query := '
|
|
404 |
(:*******************************************************:)
|
|
405 |
(: Test: K2-StartsWithFunc-5 :)
|
|
406 |
(: Written by: Frans Englich :)
|
|
407 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
408 |
(: Purpose: Compare two non-matching values returned from fn:lower-case() and fn:upper-case(). :)
|
|
409 |
(:*******************************************************:)
|
|
410 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
411 |
declare variable $vB as xs:string := ("b string", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
412 |
starts-with(upper-case($vA), lower-case($vB))
|
|
413 |
'.
|
|
414 |
|
|
415 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
416 |
|
|
417 |
|
|
418 |
result := interpreter evaluate: query.
|
|
419 |
self
|
|
420 |
assert: (self xqtsResultTextFromResult: result)
|
|
421 |
= (self xqtsResultTextFromFile:
|
|
422 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K2-StartsWithFunc-5.txt')
|
|
423 |
|
|
424 |
"Created: / 11-05-2013 / 23:06:26 / houzvjir@fel.cvut.cz"
|
|
425 |
!
|
|
426 |
|
|
427 |
test_K2_StartsWithFunc_6
|
|
428 |
|
|
429 |
| query result |
|
|
430 |
|
|
431 |
query := '
|
|
432 |
(:*******************************************************:)
|
|
433 |
(: Test: K2-StartsWithFunc-6 :)
|
|
434 |
(: Written by: Frans Englich :)
|
|
435 |
(: Date: 2007-11-22T11:31:21+01:00 :)
|
|
436 |
(: Purpose: Compare two non-matching values returned from fn:lower-case() and fn:upper-case(). :)
|
|
437 |
(:*******************************************************:)
|
|
438 |
declare variable $vA as xs:string := ("B STRING", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
439 |
declare variable $vB as xs:string := ("b string", current-time(), string(<e>content</e>))[1] treat as xs:string;
|
|
440 |
starts-with(lower-case($vA), upper-case($vB))
|
|
441 |
'.
|
|
442 |
|
|
443 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
444 |
|
|
445 |
|
|
446 |
result := interpreter evaluate: query.
|
|
447 |
self
|
|
448 |
assert: (self xqtsResultTextFromResult: result)
|
|
449 |
= (self xqtsResultTextFromFile:
|
|
450 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K2-StartsWithFunc-6.txt')
|
|
451 |
|
|
452 |
"Created: / 11-05-2013 / 23:06:51 / houzvjir@fel.cvut.cz"
|
|
453 |
!
|
|
454 |
|
|
455 |
test_K_EndsWithFunc_1
|
|
456 |
|
|
457 |
| query result |
|
|
458 |
|
|
459 |
query := '
|
|
460 |
(:*******************************************************:)
|
|
461 |
(: Test: K-EndsWithFunc-1 :)
|
|
462 |
(: Written by: Frans Englich :)
|
|
463 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
464 |
(: Purpose: A test whose essence is: `ends-with()`. :)
|
|
465 |
(:*******************************************************:)
|
|
466 |
ends-with()
|
|
467 |
'.
|
|
468 |
|
|
469 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
470 |
|
|
471 |
|
|
472 |
result := interpreter evaluate: query.
|
|
473 |
self
|
|
474 |
assert: (self xqtsResultTextFromResult: result)
|
|
475 |
= (self xqtsResultTextFromFile:
|
|
476 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K-EndsWithFunc-1.txt')
|
|
477 |
|
|
478 |
"Created: / 11-05-2013 / 22:40:33 / houzvjir@fel.cvut.cz"
|
|
479 |
!
|
|
480 |
|
|
481 |
test_K_EndsWithFunc_2
|
|
482 |
|
|
483 |
| query result |
|
|
484 |
|
|
485 |
query := '
|
|
486 |
(:*******************************************************:)
|
|
487 |
(: Test: K-EndsWithFunc-2 :)
|
|
488 |
(: Written by: Frans Englich :)
|
|
489 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
490 |
(: Purpose: A test whose essence is: `ends-with(())`. :)
|
|
491 |
(:*******************************************************:)
|
|
492 |
ends-with(())
|
|
493 |
'.
|
|
494 |
|
|
495 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
496 |
|
|
497 |
|
|
498 |
result := interpreter evaluate: query.
|
|
499 |
self
|
|
500 |
assert: (self xqtsResultTextFromResult: result)
|
|
501 |
= (self xqtsResultTextFromFile:
|
|
502 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K-EndsWithFunc-2.txt')
|
|
503 |
|
|
504 |
"Created: / 11-05-2013 / 22:42:18 / houzvjir@fel.cvut.cz"
|
|
505 |
!
|
|
506 |
|
|
507 |
test_K_EndsWithFunc_3
|
|
508 |
|
|
509 |
| query result |
|
|
510 |
|
|
511 |
query := '
|
|
512 |
(:*******************************************************:)
|
|
513 |
(: Test: K-EndsWithFunc-3 :)
|
|
514 |
(: Written by: Frans Englich :)
|
|
515 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
516 |
(: Purpose: A test whose essence is: `ends-with((), (), "http://www.w3.org/2005/xpath-functions/collation/codepoint", "wrong param")`. :)
|
|
517 |
(:*******************************************************:)
|
|
518 |
ends-with((), (),
|
|
519 |
"http://www.w3.org/2005/xpath-functions/collation/codepoint",
|
|
520 |
"wrong param")
|
|
521 |
'.
|
|
522 |
|
|
523 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
524 |
|
|
525 |
|
|
526 |
result := interpreter evaluate: query.
|
|
527 |
self
|
|
528 |
assert: (self xqtsResultTextFromResult: result)
|
|
529 |
= (self xqtsResultTextFromFile:
|
|
530 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K-EndsWithFunc-3.txt')
|
|
531 |
|
|
532 |
"Created: / 11-05-2013 / 22:42:45 / houzvjir@fel.cvut.cz"
|
|
533 |
!
|
|
534 |
|
|
535 |
test_K_EndsWithFunc_4
|
|
536 |
|
|
537 |
| query result |
|
|
538 |
|
|
539 |
query := '
|
|
540 |
(:*******************************************************:)
|
|
541 |
(: Test: K-EndsWithFunc-4 :)
|
|
542 |
(: Written by: Frans Englich :)
|
|
543 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
544 |
(: Purpose: A test whose essence is: `ends-with("a string", "a string", "http://www.example.com/COLLATION/NOT/SUPPORTED")`. :)
|
|
545 |
(:*******************************************************:)
|
|
546 |
ends-with("a string", "a string",
|
|
547 |
"http://www.example.com/COLLATION/NOT/SUPPORTED")
|
|
548 |
'.
|
|
549 |
|
|
550 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
551 |
|
|
552 |
|
|
553 |
result := interpreter evaluate: query.
|
|
554 |
self
|
|
555 |
assert: (self xqtsResultTextFromResult: result)
|
|
556 |
= (self xqtsResultTextFromFile:
|
|
557 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K-EndsWithFunc-4.txt')
|
|
558 |
|
|
559 |
"Created: / 11-05-2013 / 22:43:19 / houzvjir@fel.cvut.cz"
|
|
560 |
!
|
|
561 |
|
|
562 |
test_K_EndsWithFunc_5
|
|
563 |
|
|
564 |
| query result |
|
|
565 |
|
|
566 |
query := '
|
|
567 |
(:*******************************************************:)
|
|
568 |
(: Test: K-EndsWithFunc-5 :)
|
|
569 |
(: Written by: Frans Englich :)
|
|
570 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
571 |
(: Purpose: A test whose essence is: `ends-with("foo", "foo", "http://www.w3.org/2005/xpath-functions/collation/codepoint")`. :)
|
|
572 |
(:*******************************************************:)
|
|
573 |
ends-with("foo", "foo",
|
|
574 |
"http://www.w3.org/2005/xpath-functions/collation/codepoint")
|
|
575 |
'.
|
|
576 |
|
|
577 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
578 |
|
|
579 |
|
|
580 |
result := interpreter evaluate: query.
|
|
581 |
self
|
|
582 |
assert: (self xqtsResultTextFromResult: result)
|
|
583 |
= (self xqtsResultTextFromFile:
|
|
584 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K-EndsWithFunc-5.txt')
|
|
585 |
|
|
586 |
"Created: / 11-05-2013 / 22:43:41 / houzvjir@fel.cvut.cz"
|
|
587 |
!
|
|
588 |
|
|
589 |
test_K_EndsWithFunc_6
|
|
590 |
|
|
591 |
| query result |
|
|
592 |
|
|
593 |
query := '
|
|
594 |
(:*******************************************************:)
|
|
595 |
(: Test: K-EndsWithFunc-6 :)
|
|
596 |
(: Written by: Frans Englich :)
|
|
597 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
598 |
(: Purpose: A test whose essence is: `ends-with("tattoo", "tattoo")`. :)
|
|
599 |
(:*******************************************************:)
|
|
600 |
ends-with("tattoo", "tattoo")
|
|
601 |
'.
|
|
602 |
|
|
603 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
604 |
|
|
605 |
|
|
606 |
result := interpreter evaluate: query.
|
|
607 |
self
|
|
608 |
assert: (self xqtsResultTextFromResult: result)
|
|
609 |
= (self xqtsResultTextFromFile:
|
|
610 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K-EndsWithFunc-6.txt')
|
|
611 |
|
|
612 |
"Created: / 11-05-2013 / 22:44:09 / houzvjir@fel.cvut.cz"
|
|
613 |
!
|
|
614 |
|
|
615 |
test_K_EndsWithFunc_7
|
|
616 |
|
|
617 |
| query result |
|
|
618 |
|
|
619 |
query := '
|
|
620 |
(:*******************************************************:)
|
|
621 |
(: Test: K-EndsWithFunc-7 :)
|
|
622 |
(: Written by: Frans Englich :)
|
|
623 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
624 |
(: Purpose: A test whose essence is: `not(ends-with("tattoo", "atto"))`. :)
|
|
625 |
(:*******************************************************:)
|
|
626 |
not(ends-with("tattoo", "atto"))
|
|
627 |
'.
|
|
628 |
|
|
629 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
630 |
|
|
631 |
|
|
632 |
result := interpreter evaluate: query.
|
|
633 |
self
|
|
634 |
assert: (self xqtsResultTextFromResult: result)
|
|
635 |
= (self xqtsResultTextFromFile:
|
|
636 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/K-EndsWithFunc-7.txt')
|
|
637 |
|
|
638 |
"Created: / 11-05-2013 / 22:47:14 / houzvjir@fel.cvut.cz"
|
|
639 |
!
|
|
640 |
|
|
641 |
test_K_LowerCaseFunc_1
|
|
642 |
|
|
643 |
| query result |
|
|
644 |
|
|
645 |
query := '
|
|
646 |
(:*******************************************************:)
|
|
647 |
(: Test: K-LowerCaseFunc-1 :)
|
|
648 |
(: Written by: Frans Englich :)
|
|
649 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
650 |
(: Purpose: A test whose essence is: `lower-case()`. :)
|
|
651 |
(:*******************************************************:)
|
|
652 |
lower-case()
|
|
653 |
'.
|
|
654 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
655 |
|
|
656 |
|
|
657 |
result := interpreter evaluate: query.
|
|
658 |
self
|
|
659 |
assert: (self xqtsResultTextFromResult: result)
|
|
660 |
= (self xqtsResultTextFromFile:
|
|
661 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/K-LowerCaseFunc-1.txt')
|
|
662 |
|
|
663 |
"Created: / 11-05-2013 / 19:20:24 / jirka"
|
|
664 |
!
|
|
665 |
|
|
666 |
test_K_LowerCaseFunc_2
|
|
667 |
|
|
668 |
| query result |
|
|
669 |
|
|
670 |
query := '
|
|
671 |
(:*******************************************************:)
|
|
672 |
(: Test: K-LowerCaseFunc-2 :)
|
|
673 |
(: Written by: Frans Englich :)
|
|
674 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
675 |
(: Purpose: A test whose essence is: `lower-case("string", "wrong param")`. :)
|
|
676 |
(:*******************************************************:)
|
|
677 |
lower-case("string", "wrong param")
|
|
678 |
'.
|
|
679 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
680 |
|
|
681 |
|
|
682 |
result := interpreter evaluate: query.
|
|
683 |
self
|
|
684 |
assert: (self xqtsResultTextFromResult: result)
|
|
685 |
= (self xqtsResultTextFromFile:
|
|
686 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/K-LowerCaseFunc-2.txt')
|
|
687 |
|
|
688 |
"Created: / 11-05-2013 / 19:20:33 / jirka"
|
|
689 |
!
|
|
690 |
|
|
691 |
test_K_LowerCaseFunc_3
|
|
692 |
|
|
693 |
| query result |
|
|
694 |
|
|
695 |
query := '
|
|
696 |
(:*******************************************************:)
|
|
697 |
(: Test: K-LowerCaseFunc-3 :)
|
|
698 |
(: Written by: Frans Englich :)
|
|
699 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
700 |
(: Purpose: A test whose essence is: `lower-case(()) eq ""`. :)
|
|
701 |
(:*******************************************************:)
|
|
702 |
lower-case(()) eq ""
|
|
703 |
'.
|
|
704 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
705 |
|
|
706 |
|
|
707 |
result := interpreter evaluate: query.
|
|
708 |
self
|
|
709 |
assert: (self xqtsResultTextFromResult: result)
|
|
710 |
= (self xqtsResultTextFromFile:
|
|
711 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/K-LowerCaseFunc-3.txt')
|
|
712 |
|
|
713 |
"Created: / 11-05-2013 / 19:20:41 / jirka"
|
|
714 |
!
|
|
715 |
|
|
716 |
test_K_LowerCaseFunc_4
|
|
717 |
|
|
718 |
| query result |
|
|
719 |
|
|
720 |
query := '
|
|
721 |
(:*******************************************************:)
|
|
722 |
(: Test: K-LowerCaseFunc-4 :)
|
|
723 |
(: Written by: Frans Englich :)
|
|
724 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
725 |
(: Purpose: A test whose essence is: `upper-case("abCd0") eq "ABCD0"`. :)
|
|
726 |
(:*******************************************************:)
|
|
727 |
upper-case("abCd0") eq "ABCD0"
|
|
728 |
'.
|
|
729 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
730 |
|
|
731 |
|
|
732 |
result := interpreter evaluate: query.
|
|
733 |
self
|
|
734 |
assert: (self xqtsResultTextFromResult: result)
|
|
735 |
= (self xqtsResultTextFromFile:
|
|
736 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/K-LowerCaseFunc-4.txt')
|
|
737 |
|
|
738 |
"Created: / 11-05-2013 / 19:20:54 / jirka"
|
|
739 |
!
|
|
740 |
|
|
741 |
test_K_StartsWithFunc_1
|
|
742 |
|
|
743 |
| query result |
|
|
744 |
|
|
745 |
query := '
|
|
746 |
(:*******************************************************:)
|
|
747 |
(: Test: K-StartsWithFunc-1 :)
|
|
748 |
(: Written by: Frans Englich :)
|
|
749 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
750 |
(: Purpose: A test whose essence is: `starts-with()`. :)
|
|
751 |
(:*******************************************************:)
|
|
752 |
starts-with()
|
|
753 |
'.
|
|
754 |
|
|
755 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
756 |
|
|
757 |
|
|
758 |
result := interpreter evaluate: query.
|
|
759 |
self
|
|
760 |
assert: (self xqtsResultTextFromResult: result)
|
|
761 |
= (self xqtsResultTextFromFile:
|
|
762 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-1.txt')
|
|
763 |
|
|
764 |
"Created: / 11-05-2013 / 23:08:00 / houzvjir@fel.cvut.cz"
|
|
765 |
!
|
|
766 |
|
|
767 |
test_K_StartsWithFunc_10
|
|
768 |
|
|
769 |
| query result |
|
|
770 |
|
|
771 |
query := '
|
|
772 |
(:*******************************************************:)
|
|
773 |
(: Test: K-StartsWithFunc-10 :)
|
|
774 |
(: Written by: Frans Englich :)
|
|
775 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
776 |
(: Purpose: A test whose essence is: `starts-with("a string", ())`. :)
|
|
777 |
(:*******************************************************:)
|
|
778 |
starts-with("a string", ())
|
|
779 |
'.
|
|
780 |
|
|
781 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
782 |
|
|
783 |
|
|
784 |
result := interpreter evaluate: query.
|
|
785 |
self
|
|
786 |
assert: (self xqtsResultTextFromResult: result)
|
|
787 |
= (self xqtsResultTextFromFile:
|
|
788 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-10.txt')
|
|
789 |
|
|
790 |
"Created: / 11-05-2013 / 23:13:32 / houzvjir@fel.cvut.cz"
|
|
791 |
!
|
|
792 |
|
|
793 |
test_K_StartsWithFunc_11
|
|
794 |
|
|
795 |
| query result |
|
|
796 |
|
|
797 |
query := '
|
|
798 |
(:*******************************************************:)
|
|
799 |
(: Test: K-StartsWithFunc-11 :)
|
|
800 |
(: Written by: Frans Englich :)
|
|
801 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
802 |
(: Purpose: A test whose essence is: `not(starts-with("", "a string"))`. :)
|
|
803 |
(:*******************************************************:)
|
|
804 |
not(starts-with("", "a string"))
|
|
805 |
'.
|
|
806 |
|
|
807 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
808 |
|
|
809 |
|
|
810 |
result := interpreter evaluate: query.
|
|
811 |
self
|
|
812 |
assert: (self xqtsResultTextFromResult: result)
|
|
813 |
= (self xqtsResultTextFromFile:
|
|
814 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-11.txt')
|
|
815 |
|
|
816 |
"Created: / 11-05-2013 / 23:13:58 / houzvjir@fel.cvut.cz"
|
|
817 |
!
|
|
818 |
|
|
819 |
test_K_StartsWithFunc_2
|
|
820 |
|
|
821 |
| query result |
|
|
822 |
|
|
823 |
query := '
|
|
824 |
(:*******************************************************:)
|
|
825 |
(: Test: K-StartsWithFunc-2 :)
|
|
826 |
(: Written by: Frans Englich :)
|
|
827 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
828 |
(: Purpose: A test whose essence is: `starts-with(())`. :)
|
|
829 |
(:*******************************************************:)
|
|
830 |
starts-with(())
|
|
831 |
'.
|
|
832 |
|
|
833 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
834 |
|
|
835 |
|
|
836 |
result := interpreter evaluate: query.
|
|
837 |
self
|
|
838 |
assert: (self xqtsResultTextFromResult: result)
|
|
839 |
= (self xqtsResultTextFromFile:
|
|
840 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-2.txt')
|
|
841 |
|
|
842 |
"Created: / 11-05-2013 / 23:08:57 / houzvjir@fel.cvut.cz"
|
|
843 |
!
|
|
844 |
|
|
845 |
test_K_StartsWithFunc_3
|
|
846 |
|
|
847 |
| query result |
|
|
848 |
|
|
849 |
query := '
|
|
850 |
(:*******************************************************:)
|
|
851 |
(: Test: K-StartsWithFunc-3 :)
|
|
852 |
(: Written by: Frans Englich :)
|
|
853 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
854 |
(: Purpose: A test whose essence is: `starts-with((), (), "http://www.w3.org/2005/xpath-functions/collation/codepoint", "wrong param")`. :)
|
|
855 |
(:*******************************************************:)
|
|
856 |
starts-with((), (),
|
|
857 |
"http://www.w3.org/2005/xpath-functions/collation/codepoint",
|
|
858 |
"wrong param")
|
|
859 |
'.
|
|
860 |
|
|
861 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
862 |
|
|
863 |
|
|
864 |
result := interpreter evaluate: query.
|
|
865 |
self
|
|
866 |
assert: (self xqtsResultTextFromResult: result)
|
|
867 |
= (self xqtsResultTextFromFile:
|
|
868 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-3.txt')
|
|
869 |
|
|
870 |
"Created: / 11-05-2013 / 23:09:26 / houzvjir@fel.cvut.cz"
|
|
871 |
!
|
|
872 |
|
|
873 |
test_K_StartsWithFunc_4
|
|
874 |
|
|
875 |
| query result |
|
|
876 |
|
|
877 |
query := '
|
|
878 |
(:*******************************************************:)
|
|
879 |
(: Test: K-StartsWithFunc-4 :)
|
|
880 |
(: Written by: Frans Englich :)
|
|
881 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
882 |
(: Purpose: A test whose essence is: `starts-with("a string", "a string", "http://www.example.com/COLLATION/NOT/SUPPORTED")`. :)
|
|
883 |
(:*******************************************************:)
|
|
884 |
starts-with("a string", "a string",
|
|
885 |
"http://www.example.com/COLLATION/NOT/SUPPORTED")
|
|
886 |
'.
|
|
887 |
|
|
888 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
889 |
|
|
890 |
|
|
891 |
result := interpreter evaluate: query.
|
|
892 |
self
|
|
893 |
assert: (self xqtsResultTextFromResult: result)
|
|
894 |
= (self xqtsResultTextFromFile:
|
|
895 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-4.txt')
|
|
896 |
|
|
897 |
"Created: / 11-05-2013 / 23:09:57 / houzvjir@fel.cvut.cz"
|
|
898 |
!
|
|
899 |
|
|
900 |
test_K_StartsWithFunc_5
|
|
901 |
|
|
902 |
| query result |
|
|
903 |
|
|
904 |
query := '
|
|
905 |
(:*******************************************************:)
|
|
906 |
(: Test: K-StartsWithFunc-5 :)
|
|
907 |
(: Written by: Frans Englich :)
|
|
908 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
909 |
(: Purpose: A test whose essence is: `starts-with("foo", "foo", "http://www.w3.org/2005/xpath-functions/collation/codepoint")`. :)
|
|
910 |
(:*******************************************************:)
|
|
911 |
starts-with("foo", "foo",
|
|
912 |
"http://www.w3.org/2005/xpath-functions/collation/codepoint")
|
|
913 |
'.
|
|
914 |
|
|
915 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
916 |
|
|
917 |
|
|
918 |
result := interpreter evaluate: query.
|
|
919 |
self
|
|
920 |
assert: (self xqtsResultTextFromResult: result)
|
|
921 |
= (self xqtsResultTextFromFile:
|
|
922 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-5.txt')
|
|
923 |
|
|
924 |
"Created: / 11-05-2013 / 23:10:29 / houzvjir@fel.cvut.cz"
|
|
925 |
!
|
|
926 |
|
|
927 |
test_K_StartsWithFunc_6
|
|
928 |
|
|
929 |
| query result |
|
|
930 |
|
|
931 |
query := '
|
|
932 |
(:*******************************************************:)
|
|
933 |
(: Test: K-StartsWithFunc-6 :)
|
|
934 |
(: Written by: Frans Englich :)
|
|
935 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
936 |
(: Purpose: A test whose essence is: `starts-with("foo", "foo")`. :)
|
|
937 |
(:*******************************************************:)
|
|
938 |
starts-with("foo", "foo")
|
|
939 |
'.
|
|
940 |
|
|
941 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
942 |
|
|
943 |
|
|
944 |
result := interpreter evaluate: query.
|
|
945 |
self
|
|
946 |
assert: (self xqtsResultTextFromResult: result)
|
|
947 |
= (self xqtsResultTextFromFile:
|
|
948 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-6.txt')
|
|
949 |
|
|
950 |
"Created: / 11-05-2013 / 23:10:49 / houzvjir@fel.cvut.cz"
|
|
951 |
!
|
|
952 |
|
|
953 |
test_K_StartsWithFunc_7
|
|
954 |
|
|
955 |
| query result |
|
|
956 |
|
|
957 |
query := '
|
|
958 |
(:*******************************************************:)
|
|
959 |
(: Test: K-StartsWithFunc-7 :)
|
|
960 |
(: Written by: Frans Englich :)
|
|
961 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
962 |
(: Purpose: A test whose essence is: `starts-with("tattoo", "tat")`. :)
|
|
963 |
(:*******************************************************:)
|
|
964 |
starts-with("tattoo", "tat")
|
|
965 |
'.
|
|
966 |
|
|
967 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
968 |
|
|
969 |
|
|
970 |
result := interpreter evaluate: query.
|
|
971 |
self
|
|
972 |
assert: (self xqtsResultTextFromResult: result)
|
|
973 |
= (self xqtsResultTextFromFile:
|
|
974 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-7.txt')
|
|
975 |
|
|
976 |
"Created: / 11-05-2013 / 23:11:19 / houzvjir@fel.cvut.cz"
|
|
977 |
!
|
|
978 |
|
|
979 |
test_K_StartsWithFunc_8
|
|
980 |
|
|
981 |
| query result |
|
|
982 |
|
|
983 |
query := '
|
|
984 |
(:*******************************************************:)
|
|
985 |
(: Test: K-StartsWithFunc-8 :)
|
|
986 |
(: Written by: Frans Englich :)
|
|
987 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
988 |
(: Purpose: A test whose essence is: `not(starts-with("tattoo", "att"))`. :)
|
|
989 |
(:*******************************************************:)
|
|
990 |
not(starts-with("tattoo", "att"))
|
|
991 |
'.
|
|
992 |
|
|
993 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
994 |
|
|
995 |
|
|
996 |
result := interpreter evaluate: query.
|
|
997 |
self
|
|
998 |
assert: (self xqtsResultTextFromResult: result)
|
|
999 |
= (self xqtsResultTextFromFile:
|
|
1000 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-8.txt')
|
|
1001 |
|
|
1002 |
"Created: / 11-05-2013 / 23:11:55 / houzvjir@fel.cvut.cz"
|
|
1003 |
!
|
|
1004 |
|
|
1005 |
test_K_StartsWithFunc_9
|
|
1006 |
|
|
1007 |
| query result |
|
|
1008 |
|
|
1009 |
query := '
|
|
1010 |
(:*******************************************************:)
|
|
1011 |
(: Test: K-StartsWithFunc-9 :)
|
|
1012 |
(: Written by: Frans Englich :)
|
|
1013 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1014 |
(: Purpose: A test whose essence is: `starts-with((), ())`. :)
|
|
1015 |
(:*******************************************************:)
|
|
1016 |
starts-with((), ())
|
|
1017 |
'.
|
|
1018 |
|
|
1019 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1020 |
|
|
1021 |
|
|
1022 |
result := interpreter evaluate: query.
|
|
1023 |
self
|
|
1024 |
assert: (self xqtsResultTextFromResult: result)
|
|
1025 |
= (self xqtsResultTextFromFile:
|
|
1026 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/K-StartsWithFunc-9.txt')
|
|
1027 |
|
|
1028 |
"Created: / 11-05-2013 / 23:13:03 / houzvjir@fel.cvut.cz"
|
|
1029 |
!
|
|
1030 |
|
|
1031 |
test_K_StringLengthFunc_1
|
|
1032 |
|
|
1033 |
| query result |
|
|
1034 |
|
|
1035 |
query := '
|
|
1036 |
(:*******************************************************:)
|
|
1037 |
(: Test: K-StringLengthFunc-1 :)
|
|
1038 |
(: Written by: Frans Englich :)
|
|
1039 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1040 |
(: Purpose: A test whose essence is: `string-length("a string", "wrong param")`. :)
|
|
1041 |
(:*******************************************************:)
|
|
1042 |
string-length("a string", "wrong param")
|
|
1043 |
|
|
1044 |
'.
|
|
1045 |
|
|
1046 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1047 |
|
|
1048 |
result := interpreter evaluate: query.
|
|
1049 |
|
|
1050 |
self
|
|
1051 |
assert: (self xqtsResultTextFromResult: result)
|
|
1052 |
= (self xqtsResultTextFromFile:
|
|
1053 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/K-StringLengthFunc-1.txt')
|
|
1054 |
|
|
1055 |
"Created: / 12-05-2013 / 13:23:40 / houzvjir@fel.cvut.cz"
|
|
1056 |
!
|
|
1057 |
|
|
1058 |
test_K_StringLengthFunc_2
|
|
1059 |
|
|
1060 |
| query result |
|
|
1061 |
|
|
1062 |
query := '
|
|
1063 |
(:*******************************************************:)
|
|
1064 |
(: Test: K-StringLengthFunc-2 :)
|
|
1065 |
(: Written by: Frans Englich :)
|
|
1066 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1067 |
(: Purpose: A test whose essence is: `string-length("ebv") eq 3`. :)
|
|
1068 |
(:*******************************************************:)
|
|
1069 |
string-length("ebv") eq 3
|
|
1070 |
|
|
1071 |
'.
|
|
1072 |
|
|
1073 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1074 |
|
|
1075 |
result := interpreter evaluate: query.
|
|
1076 |
|
|
1077 |
self
|
|
1078 |
assert: (self xqtsResultTextFromResult: result)
|
|
1079 |
= (self xqtsResultTextFromFile:
|
|
1080 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/K-StringLengthFunc-2.txt')
|
|
1081 |
|
|
1082 |
"Created: / 12-05-2013 / 13:26:55 / houzvjir@fel.cvut.cz"
|
|
1083 |
!
|
|
1084 |
|
|
1085 |
test_K_StringLengthFunc_3
|
|
1086 |
|
|
1087 |
| query result |
|
|
1088 |
|
|
1089 |
query := '
|
|
1090 |
(:*******************************************************:)
|
|
1091 |
(: Test: K-StringLengthFunc-3 :)
|
|
1092 |
(: Written by: Frans Englich :)
|
|
1093 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1094 |
(: Purpose: A test whose essence is: `string-length("ebv") instance of xs:integer`. :)
|
|
1095 |
(:*******************************************************:)
|
|
1096 |
string-length("ebv") instance of xs:integer
|
|
1097 |
|
|
1098 |
'.
|
|
1099 |
|
|
1100 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1101 |
|
|
1102 |
result := interpreter evaluate: query.
|
|
1103 |
|
|
1104 |
self
|
|
1105 |
assert: (self xqtsResultTextFromResult: result)
|
|
1106 |
= (self xqtsResultTextFromFile:
|
|
1107 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/K-StringLengthFunc-3.txt')
|
|
1108 |
|
|
1109 |
"Created: / 12-05-2013 / 13:27:37 / houzvjir@fel.cvut.cz"
|
|
1110 |
!
|
|
1111 |
|
|
1112 |
test_K_StringLengthFunc_4
|
|
1113 |
|
|
1114 |
| query result |
|
|
1115 |
|
|
1116 |
query := '
|
|
1117 |
(:*******************************************************:)
|
|
1118 |
(: Test: K-StringLengthFunc-4 :)
|
|
1119 |
(: Written by: Frans Englich :)
|
|
1120 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1121 |
(: Purpose: A test whose essence is: `string-length(()) eq 0`. :)
|
|
1122 |
(:*******************************************************:)
|
|
1123 |
string-length(()) eq 0
|
|
1124 |
|
|
1125 |
'.
|
|
1126 |
|
|
1127 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1128 |
|
|
1129 |
result := interpreter evaluate: query.
|
|
1130 |
|
|
1131 |
self
|
|
1132 |
assert: (self xqtsResultTextFromResult: result)
|
|
1133 |
= (self xqtsResultTextFromFile:
|
|
1134 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/K-StringLengthFunc-4.txt')
|
|
1135 |
|
|
1136 |
"Created: / 12-05-2013 / 13:28:04 / houzvjir@fel.cvut.cz"
|
|
1137 |
!
|
|
1138 |
|
|
1139 |
test_K_StringLengthFunc_5
|
|
1140 |
|
|
1141 |
| query result |
|
|
1142 |
|
|
1143 |
query := '
|
|
1144 |
(:*******************************************************:)
|
|
1145 |
(: Test: K-StringLengthFunc-5 :)
|
|
1146 |
(: Written by: Frans Englich :)
|
|
1147 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1148 |
(: Purpose: A test whose essence is: `string-length("") eq 0`. :)
|
|
1149 |
(:*******************************************************:)
|
|
1150 |
string-length("") eq 0
|
|
1151 |
|
|
1152 |
'.
|
|
1153 |
|
|
1154 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1155 |
|
|
1156 |
result := interpreter evaluate: query.
|
|
1157 |
|
|
1158 |
self
|
|
1159 |
assert: (self xqtsResultTextFromResult: result)
|
|
1160 |
= (self xqtsResultTextFromFile:
|
|
1161 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/K-StringLengthFunc-5.txt')
|
|
1162 |
|
|
1163 |
"Created: / 12-05-2013 / 13:28:25 / houzvjir@fel.cvut.cz"
|
|
1164 |
!
|
|
1165 |
|
|
1166 |
test_K_StringLengthFunc_6
|
|
1167 |
|
|
1168 |
| query result |
|
|
1169 |
|
|
1170 |
query := '
|
|
1171 |
(:*******************************************************:)
|
|
1172 |
(: Test: K-StringLengthFunc-6 :)
|
|
1173 |
(: Written by: Frans Englich :)
|
|
1174 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1175 |
(: Purpose: A test whose essence is: `string-length(()) instance of xs:integer`. :)
|
|
1176 |
(:*******************************************************:)
|
|
1177 |
string-length(()) instance of xs:integer
|
|
1178 |
|
|
1179 |
'.
|
|
1180 |
|
|
1181 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1182 |
|
|
1183 |
result := interpreter evaluate: query.
|
|
1184 |
|
|
1185 |
self
|
|
1186 |
assert: (self xqtsResultTextFromResult: result)
|
|
1187 |
= (self xqtsResultTextFromFile:
|
|
1188 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/K-StringLengthFunc-6.txt')
|
|
1189 |
|
|
1190 |
"Created: / 12-05-2013 / 13:28:58 / houzvjir@fel.cvut.cz"
|
|
1191 |
!
|
|
1192 |
|
|
1193 |
test_K_StringLengthFunc_7
|
|
1194 |
|
|
1195 |
| query result |
|
|
1196 |
|
|
1197 |
query := '
|
|
1198 |
(:*******************************************************:)
|
|
1199 |
(: Test: K-StringLengthFunc-7 :)
|
|
1200 |
(: Written by: Frans Englich :)
|
|
1201 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1202 |
(: Purpose: A test whose essence is: `if(false()) then string-length() else true()`. :)
|
|
1203 |
(:*******************************************************:)
|
|
1204 |
if(false()) then string-length() else true()
|
|
1205 |
|
|
1206 |
'.
|
|
1207 |
|
|
1208 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1209 |
|
|
1210 |
result := interpreter evaluate: query.
|
|
1211 |
|
|
1212 |
self
|
|
1213 |
assert: (self xqtsResultTextFromResult: result)
|
|
1214 |
= (self xqtsResultTextFromFile:
|
|
1215 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/K-StringLengthFunc-7.txt')
|
|
1216 |
|
|
1217 |
"Created: / 12-05-2013 / 13:30:00 / houzvjir@fel.cvut.cz"
|
|
1218 |
!
|
|
1219 |
|
|
1220 |
test_K_StringLengthFunc_8
|
|
1221 |
|
|
1222 |
| query result |
|
|
1223 |
|
|
1224 |
query := '
|
|
1225 |
(:*******************************************************:)
|
|
1226 |
(: Test: K-StringLengthFunc-8 :)
|
|
1227 |
(: Written by: Frans Englich :)
|
|
1228 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1229 |
(: Purpose: A test whose essence is: `string-length("Harp not on that string, madam; that is past.") eq 45`. :)
|
|
1230 |
(:*******************************************************:)
|
|
1231 |
string-length("Harp not on that string, madam; that is past.")
|
|
1232 |
eq 45
|
|
1233 |
|
|
1234 |
'.
|
|
1235 |
|
|
1236 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1237 |
|
|
1238 |
result := interpreter evaluate: query.
|
|
1239 |
|
|
1240 |
self
|
|
1241 |
assert: (self xqtsResultTextFromResult: result)
|
|
1242 |
= (self xqtsResultTextFromFile:
|
|
1243 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/K-StringLengthFunc-8.txt')
|
|
1244 |
|
|
1245 |
"Created: / 12-05-2013 / 13:30:33 / houzvjir@fel.cvut.cz"
|
|
1246 |
!
|
|
1247 |
|
|
1248 |
test_K_SubstringAfterFunc_1
|
|
1249 |
|
|
1250 |
| query result |
|
|
1251 |
|
|
1252 |
query := '
|
|
1253 |
(:*******************************************************:)
|
|
1254 |
(: Test: K-SubstringAfterFunc-1 :)
|
|
1255 |
(: Written by: Frans Englich :)
|
|
1256 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1257 |
(: Purpose: A test whose essence is: `substring-after()`. :)
|
|
1258 |
(:*******************************************************:)
|
|
1259 |
substring-after()
|
|
1260 |
'.
|
|
1261 |
|
|
1262 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1263 |
|
|
1264 |
|
|
1265 |
result := interpreter evaluate: query.
|
|
1266 |
self
|
|
1267 |
assert: (self xqtsResultTextFromResult: result)
|
|
1268 |
= (self xqtsResultTextFromFile:
|
|
1269 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-1.txt')
|
|
1270 |
|
|
1271 |
"Created: / 11-05-2013 / 23:19:25 / houzvjir@fel.cvut.cz"
|
|
1272 |
!
|
|
1273 |
|
|
1274 |
test_K_SubstringAfterFunc_10
|
|
1275 |
|
|
1276 |
| query result |
|
|
1277 |
|
|
1278 |
query := '
|
|
1279 |
(:*******************************************************:)
|
|
1280 |
(: Test: K-SubstringAfterFunc-10 :)
|
|
1281 |
(: Written by: Frans Englich :)
|
|
1282 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1283 |
(: Purpose: A test whose essence is: `substring-after("a string", ()) eq "a string"`. :)
|
|
1284 |
(:*******************************************************:)
|
|
1285 |
substring-after("a string", ()) eq "a string"
|
|
1286 |
'.
|
|
1287 |
|
|
1288 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1289 |
|
|
1290 |
|
|
1291 |
result := interpreter evaluate: query.
|
|
1292 |
self
|
|
1293 |
assert: (self xqtsResultTextFromResult: result)
|
|
1294 |
= (self xqtsResultTextFromFile:
|
|
1295 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-10.txt')
|
|
1296 |
|
|
1297 |
"Created: / 11-05-2013 / 23:20:31 / houzvjir@fel.cvut.cz"
|
|
1298 |
!
|
|
1299 |
|
|
1300 |
test_K_SubstringAfterFunc_11
|
|
1301 |
|
|
1302 |
| query result |
|
|
1303 |
|
|
1304 |
query := '
|
|
1305 |
(:*******************************************************:)
|
|
1306 |
(: Test: K-SubstringAfterFunc-11 :)
|
|
1307 |
(: Written by: Frans Englich :)
|
|
1308 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1309 |
(: Purpose: A test whose essence is: `substring-after("a string", "not in other") eq ""`. :)
|
|
1310 |
(:*******************************************************:)
|
|
1311 |
substring-after("a string", "not in other") eq ""
|
|
1312 |
'.
|
|
1313 |
|
|
1314 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1315 |
|
|
1316 |
|
|
1317 |
result := interpreter evaluate: query.
|
|
1318 |
self
|
|
1319 |
assert: (self xqtsResultTextFromResult: result)
|
|
1320 |
= (self xqtsResultTextFromFile:
|
|
1321 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-11.txt')
|
|
1322 |
|
|
1323 |
"Created: / 11-05-2013 / 23:21:03 / houzvjir@fel.cvut.cz"
|
|
1324 |
!
|
|
1325 |
|
|
1326 |
test_K_SubstringAfterFunc_2
|
|
1327 |
|
|
1328 |
| query result |
|
|
1329 |
|
|
1330 |
query := '
|
|
1331 |
(:*******************************************************:)
|
|
1332 |
(: Test: K-SubstringAfterFunc-2 :)
|
|
1333 |
(: Written by: Frans Englich :)
|
|
1334 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1335 |
(: Purpose: A test whose essence is: `substring-after(())`. :)
|
|
1336 |
(:*******************************************************:)
|
|
1337 |
substring-after(())
|
|
1338 |
'.
|
|
1339 |
|
|
1340 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1341 |
|
|
1342 |
|
|
1343 |
result := interpreter evaluate: query.
|
|
1344 |
self
|
|
1345 |
assert: (self xqtsResultTextFromResult: result)
|
|
1346 |
= (self xqtsResultTextFromFile:
|
|
1347 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-2.txt')
|
|
1348 |
|
|
1349 |
"Created: / 11-05-2013 / 23:21:32 / houzvjir@fel.cvut.cz"
|
|
1350 |
!
|
|
1351 |
|
|
1352 |
test_K_SubstringAfterFunc_3
|
|
1353 |
|
|
1354 |
| query result |
|
|
1355 |
|
|
1356 |
query := '
|
|
1357 |
(:*******************************************************:)
|
|
1358 |
(: Test: K-SubstringAfterFunc-3 :)
|
|
1359 |
(: Written by: Frans Englich :)
|
|
1360 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1361 |
(: Purpose: A test whose essence is: `substring-after((), (), "http://www.w3.org/2005/xpath-functions/collation/codepoint", "wrong param")`. :)
|
|
1362 |
(:*******************************************************:)
|
|
1363 |
substring-after((), (),
|
|
1364 |
"http://www.w3.org/2005/xpath-functions/collation/codepoint",
|
|
1365 |
"wrong param")
|
|
1366 |
'.
|
|
1367 |
|
|
1368 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1369 |
|
|
1370 |
|
|
1371 |
result := interpreter evaluate: query.
|
|
1372 |
self
|
|
1373 |
assert: (self xqtsResultTextFromResult: result)
|
|
1374 |
= (self xqtsResultTextFromFile:
|
|
1375 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-3.txt')
|
|
1376 |
|
|
1377 |
"Created: / 11-05-2013 / 23:22:26 / houzvjir@fel.cvut.cz"
|
|
1378 |
!
|
|
1379 |
|
|
1380 |
test_K_SubstringAfterFunc_4
|
|
1381 |
|
|
1382 |
| query result |
|
|
1383 |
|
|
1384 |
query := '
|
|
1385 |
(:*******************************************************:)
|
|
1386 |
(: Test: K-SubstringAfterFunc-4 :)
|
|
1387 |
(: Written by: Frans Englich :)
|
|
1388 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1389 |
(: Purpose: A test whose essence is: `substring-after("a string", "a string", "http://www.example.com/COLLATION/NOT/SUPPORTED")`. :)
|
|
1390 |
(:*******************************************************:)
|
|
1391 |
substring-after("a string", "a string",
|
|
1392 |
"http://www.example.com/COLLATION/NOT/SUPPORTED")
|
|
1393 |
'.
|
|
1394 |
|
|
1395 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1396 |
|
|
1397 |
|
|
1398 |
result := interpreter evaluate: query.
|
|
1399 |
self
|
|
1400 |
assert: (self xqtsResultTextFromResult: result)
|
|
1401 |
= (self xqtsResultTextFromFile:
|
|
1402 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-4.txt')
|
|
1403 |
|
|
1404 |
"Created: / 11-05-2013 / 23:22:55 / houzvjir@fel.cvut.cz"
|
|
1405 |
!
|
|
1406 |
|
|
1407 |
test_K_SubstringAfterFunc_5
|
|
1408 |
|
|
1409 |
| query result |
|
|
1410 |
|
|
1411 |
query := '
|
|
1412 |
(:*******************************************************:)
|
|
1413 |
(: Test: K-SubstringAfterFunc-5 :)
|
|
1414 |
(: Written by: Frans Englich :)
|
|
1415 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1416 |
(: Purpose: A test whose essence is: `substring-after("foo", "fo", "http://www.w3.org/2005/xpath-functions/collation/codepoint") eq "o"`. :)
|
|
1417 |
(:*******************************************************:)
|
|
1418 |
substring-after("foo", "fo",
|
|
1419 |
"http://www.w3.org/2005/xpath-functions/collation/codepoint") eq "o"
|
|
1420 |
'.
|
|
1421 |
|
|
1422 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1423 |
|
|
1424 |
|
|
1425 |
result := interpreter evaluate: query.
|
|
1426 |
self
|
|
1427 |
assert: (self xqtsResultTextFromResult: result)
|
|
1428 |
= (self xqtsResultTextFromFile:
|
|
1429 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-5.txt')
|
|
1430 |
|
|
1431 |
"Created: / 11-05-2013 / 23:23:21 / houzvjir@fel.cvut.cz"
|
|
1432 |
!
|
|
1433 |
|
|
1434 |
test_K_SubstringAfterFunc_6
|
|
1435 |
|
|
1436 |
| query result |
|
|
1437 |
|
|
1438 |
query := '
|
|
1439 |
(:*******************************************************:)
|
|
1440 |
(: Test: K-SubstringAfterFunc-6 :)
|
|
1441 |
(: Written by: Frans Englich :)
|
|
1442 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1443 |
(: Purpose: A test whose essence is: `substring-after("tattoo", "tat") eq "too"`. :)
|
|
1444 |
(:*******************************************************:)
|
|
1445 |
substring-after("tattoo", "tat") eq "too"
|
|
1446 |
'.
|
|
1447 |
|
|
1448 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1449 |
|
|
1450 |
|
|
1451 |
result := interpreter evaluate: query.
|
|
1452 |
self
|
|
1453 |
assert: (self xqtsResultTextFromResult: result)
|
|
1454 |
= (self xqtsResultTextFromFile:
|
|
1455 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-6.txt')
|
|
1456 |
|
|
1457 |
"Created: / 11-05-2013 / 23:23:45 / houzvjir@fel.cvut.cz"
|
|
1458 |
!
|
|
1459 |
|
|
1460 |
test_K_SubstringAfterFunc_7
|
|
1461 |
|
|
1462 |
| query result |
|
|
1463 |
|
|
1464 |
query := '
|
|
1465 |
(:*******************************************************:)
|
|
1466 |
(: Test: K-SubstringAfterFunc-7 :)
|
|
1467 |
(: Written by: Frans Englich :)
|
|
1468 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1469 |
(: Purpose: A test whose essence is: `substring-after("tattoo", "tattoo") eq ""`. :)
|
|
1470 |
(:*******************************************************:)
|
|
1471 |
substring-after("tattoo", "tattoo") eq ""
|
|
1472 |
'.
|
|
1473 |
|
|
1474 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1475 |
|
|
1476 |
|
|
1477 |
result := interpreter evaluate: query.
|
|
1478 |
self
|
|
1479 |
assert: (self xqtsResultTextFromResult: result)
|
|
1480 |
= (self xqtsResultTextFromFile:
|
|
1481 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-7.txt')
|
|
1482 |
|
|
1483 |
"Created: / 11-05-2013 / 23:24:20 / houzvjir@fel.cvut.cz"
|
|
1484 |
!
|
|
1485 |
|
|
1486 |
test_K_SubstringAfterFunc_8
|
|
1487 |
|
|
1488 |
| query result |
|
|
1489 |
|
|
1490 |
query := '
|
|
1491 |
(:*******************************************************:)
|
|
1492 |
(: Test: K-SubstringAfterFunc-8 :)
|
|
1493 |
(: Written by: Frans Englich :)
|
|
1494 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1495 |
(: Purpose: A test whose essence is: `substring-after("abcdefgedij", "def") eq "gedij"`. :)
|
|
1496 |
(:*******************************************************:)
|
|
1497 |
substring-after("abcdefgedij", "def") eq "gedij"
|
|
1498 |
'.
|
|
1499 |
|
|
1500 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1501 |
|
|
1502 |
|
|
1503 |
result := interpreter evaluate: query.
|
|
1504 |
self
|
|
1505 |
assert: (self xqtsResultTextFromResult: result)
|
|
1506 |
= (self xqtsResultTextFromFile:
|
|
1507 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-8.txt')
|
|
1508 |
|
|
1509 |
"Created: / 11-05-2013 / 23:24:43 / houzvjir@fel.cvut.cz"
|
|
1510 |
!
|
|
1511 |
|
|
1512 |
test_K_SubstringAfterFunc_9
|
|
1513 |
|
|
1514 |
| query result |
|
|
1515 |
|
|
1516 |
query := '
|
|
1517 |
(:*******************************************************:)
|
|
1518 |
(: Test: K-SubstringAfterFunc-9 :)
|
|
1519 |
(: Written by: Frans Englich :)
|
|
1520 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1521 |
(: Purpose: A test whose essence is: `substring-after((), ()) eq ""`. :)
|
|
1522 |
(:*******************************************************:)
|
|
1523 |
substring-after((), ()) eq ""
|
|
1524 |
'.
|
|
1525 |
|
|
1526 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1527 |
|
|
1528 |
|
|
1529 |
result := interpreter evaluate: query.
|
|
1530 |
self
|
|
1531 |
assert: (self xqtsResultTextFromResult: result)
|
|
1532 |
= (self xqtsResultTextFromFile:
|
|
1533 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/K-SubstringAfterFunc-9.txt')
|
|
1534 |
|
|
1535 |
"Created: / 11-05-2013 / 23:25:06 / houzvjir@fel.cvut.cz"
|
|
1536 |
!
|
|
1537 |
|
|
1538 |
test_K_SubstringBeforeFunc_1
|
|
1539 |
|
|
1540 |
| query result |
|
|
1541 |
|
|
1542 |
query := '
|
|
1543 |
(:*******************************************************:)
|
|
1544 |
(: Test: K-SubstringBeforeFunc-1 :)
|
|
1545 |
(: Written by: Frans Englich :)
|
|
1546 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1547 |
(: Purpose: A test whose essence is: `substring-before()`. :)
|
|
1548 |
(:*******************************************************:)
|
|
1549 |
substring-before()
|
|
1550 |
'.
|
|
1551 |
|
|
1552 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1553 |
|
|
1554 |
|
|
1555 |
result := interpreter evaluate: query.
|
|
1556 |
self
|
|
1557 |
assert: (self xqtsResultTextFromResult: result)
|
|
1558 |
= (self xqtsResultTextFromFile:
|
|
1559 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/K-SubstringBeforeFunc-1.txt')
|
|
1560 |
|
|
1561 |
"Created: / 12-05-2013 / 08:04:40 / houzvjir@fel.cvut.cz"
|
|
1562 |
!
|
|
1563 |
|
|
1564 |
test_K_SubstringBeforeFunc_10
|
|
1565 |
|
|
1566 |
| query result |
|
|
1567 |
|
|
1568 |
query := '
|
|
1569 |
(:*******************************************************:)
|
|
1570 |
(: Test: K-SubstringBeforeFunc-10 :)
|
|
1571 |
(: Written by: Frans Englich :)
|
|
1572 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1573 |
(: Purpose: A test whose essence is: `substring-before("a string", "not in other") eq ""`. :)
|
|
1574 |
(:*******************************************************:)
|
|
1575 |
substring-before("a string", "not in other") eq ""
|
|
1576 |
'.
|
|
1577 |
|
|
1578 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1579 |
|
|
1580 |
|
|
1581 |
result := interpreter evaluate: query.
|
|
1582 |
self
|
|
1583 |
assert: (self xqtsResultTextFromResult: result)
|
|
1584 |
= (self xqtsResultTextFromFile:
|
|
1585 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/K-SubstringBeforeFunc-10.txt')
|
|
1586 |
|
|
1587 |
"Created: / 12-05-2013 / 08:05:55 / houzvjir@fel.cvut.cz"
|
|
1588 |
!
|
|
1589 |
|
|
1590 |
test_K_SubstringBeforeFunc_2
|
|
1591 |
|
|
1592 |
| query result |
|
|
1593 |
|
|
1594 |
query := '
|
|
1595 |
(:*******************************************************:)
|
|
1596 |
(: Test: K-SubstringBeforeFunc-2 :)
|
|
1597 |
(: Written by: Frans Englich :)
|
|
1598 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1599 |
(: Purpose: A test whose essence is: `substring-before(())`. :)
|
|
1600 |
(:*******************************************************:)
|
|
1601 |
substring-before(())
|
|
1602 |
'.
|
|
1603 |
|
|
1604 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1605 |
|
|
1606 |
|
|
1607 |
result := interpreter evaluate: query.
|
|
1608 |
self
|
|
1609 |
assert: (self xqtsResultTextFromResult: result)
|
|
1610 |
= (self xqtsResultTextFromFile:
|
|
1611 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/K-SubstringBeforeFunc-2.txt')
|
|
1612 |
|
|
1613 |
"Created: / 12-05-2013 / 08:07:17 / houzvjir@fel.cvut.cz"
|
|
1614 |
!
|
|
1615 |
|
|
1616 |
test_K_SubstringBeforeFunc_3
|
|
1617 |
|
|
1618 |
| query result |
|
|
1619 |
|
|
1620 |
query := '
|
|
1621 |
(:*******************************************************:)
|
|
1622 |
(: Test: K-SubstringBeforeFunc-3 :)
|
|
1623 |
(: Written by: Frans Englich :)
|
|
1624 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1625 |
(: Purpose: A test whose essence is: `substring-before((), (), "http://www.w3.org/2005/xpath-functions/collation/codepoint", "wrong param")`. :)
|
|
1626 |
(:*******************************************************:)
|
|
1627 |
substring-before((), (),
|
|
1628 |
"http://www.w3.org/2005/xpath-functions/collation/codepoint",
|
|
1629 |
"wrong param")
|
|
1630 |
'.
|
|
1631 |
|
|
1632 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1633 |
|
|
1634 |
|
|
1635 |
result := interpreter evaluate: query.
|
|
1636 |
self
|
|
1637 |
assert: (self xqtsResultTextFromResult: result)
|
|
1638 |
= (self xqtsResultTextFromFile:
|
|
1639 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/K-SubstringBeforeFunc-3.txt')
|
|
1640 |
|
|
1641 |
"Created: / 12-05-2013 / 08:07:49 / houzvjir@fel.cvut.cz"
|
|
1642 |
!
|
|
1643 |
|
|
1644 |
test_K_SubstringBeforeFunc_4
|
|
1645 |
|
|
1646 |
| query result |
|
|
1647 |
|
|
1648 |
query := '
|
|
1649 |
(:*******************************************************:)
|
|
1650 |
(: Test: K-SubstringBeforeFunc-4 :)
|
|
1651 |
(: Written by: Frans Englich :)
|
|
1652 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1653 |
(: Purpose: A test whose essence is: `substring-before("a string", "a string", "http://www.example.com/COLLATION/NOT/SUPPORTED")`. :)
|
|
1654 |
(:*******************************************************:)
|
|
1655 |
substring-before("a string", "a string",
|
|
1656 |
"http://www.example.com/COLLATION/NOT/SUPPORTED")
|
|
1657 |
'.
|
|
1658 |
|
|
1659 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1660 |
|
|
1661 |
|
|
1662 |
result := interpreter evaluate: query.
|
|
1663 |
self
|
|
1664 |
assert: (self xqtsResultTextFromResult: result)
|
|
1665 |
= (self xqtsResultTextFromFile:
|
|
1666 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/K-SubstringBeforeFunc-4.txt')
|
|
1667 |
|
|
1668 |
"Created: / 12-05-2013 / 08:08:32 / houzvjir@fel.cvut.cz"
|
|
1669 |
!
|
|
1670 |
|
|
1671 |
test_K_SubstringBeforeFunc_5
|
|
1672 |
|
|
1673 |
| query result |
|
|
1674 |
|
|
1675 |
query := '
|
|
1676 |
(:*******************************************************:)
|
|
1677 |
(: Test: K-SubstringBeforeFunc-5 :)
|
|
1678 |
(: Written by: Frans Englich :)
|
|
1679 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1680 |
(: Purpose: A test whose essence is: `substring-before("foo", "oo", "http://www.w3.org/2005/xpath-functions/collation/codepoint") eq "f"`. :)
|
|
1681 |
(:*******************************************************:)
|
|
1682 |
substring-before("foo", "oo",
|
|
1683 |
"http://www.w3.org/2005/xpath-functions/collation/codepoint") eq "f"
|
|
1684 |
'.
|
|
1685 |
|
|
1686 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1687 |
|
|
1688 |
|
|
1689 |
result := interpreter evaluate: query.
|
|
1690 |
self
|
|
1691 |
assert: (self xqtsResultTextFromResult: result)
|
|
1692 |
= (self xqtsResultTextFromFile:
|
|
1693 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/K-SubstringBeforeFunc-5.txt')
|
|
1694 |
|
|
1695 |
"Created: / 12-05-2013 / 08:09:01 / houzvjir@fel.cvut.cz"
|
|
1696 |
!
|
|
1697 |
|
|
1698 |
test_K_SubstringBeforeFunc_6
|
|
1699 |
|
|
1700 |
| query result |
|
|
1701 |
|
|
1702 |
query := '
|
|
1703 |
(:*******************************************************:)
|
|
1704 |
(: Test: K-SubstringBeforeFunc-6 :)
|
|
1705 |
(: Written by: Frans Englich :)
|
|
1706 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1707 |
(: Purpose: A test whose essence is: `substring-before("tattoo", "attoo") eq "t"`. :)
|
|
1708 |
(:*******************************************************:)
|
|
1709 |
substring-before("tattoo", "attoo") eq "t"
|
|
1710 |
'.
|
|
1711 |
|
|
1712 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1713 |
|
|
1714 |
|
|
1715 |
result := interpreter evaluate: query.
|
|
1716 |
self
|
|
1717 |
assert: (self xqtsResultTextFromResult: result)
|
|
1718 |
= (self xqtsResultTextFromFile:
|
|
1719 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/K-SubstringBeforeFunc-6.txt')
|
|
1720 |
|
|
1721 |
"Created: / 12-05-2013 / 08:09:52 / houzvjir@fel.cvut.cz"
|
|
1722 |
!
|
|
1723 |
|
|
1724 |
test_K_SubstringBeforeFunc_7
|
|
1725 |
|
|
1726 |
| query result |
|
|
1727 |
|
|
1728 |
query := '
|
|
1729 |
(:*******************************************************:)
|
|
1730 |
(: Test: K-SubstringBeforeFunc-7 :)
|
|
1731 |
(: Written by: Frans Englich :)
|
|
1732 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1733 |
(: Purpose: A test whose essence is: `substring-before("tattoo", "tatto") eq ""`. :)
|
|
1734 |
(:*******************************************************:)
|
|
1735 |
substring-before("tattoo", "tatto") eq ""
|
|
1736 |
'.
|
|
1737 |
|
|
1738 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1739 |
|
|
1740 |
|
|
1741 |
result := interpreter evaluate: query.
|
|
1742 |
self
|
|
1743 |
assert: (self xqtsResultTextFromResult: result)
|
|
1744 |
= (self xqtsResultTextFromFile:
|
|
1745 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/K-SubstringBeforeFunc-7.txt')
|
|
1746 |
|
|
1747 |
"Created: / 12-05-2013 / 08:11:21 / houzvjir@fel.cvut.cz"
|
|
1748 |
!
|
|
1749 |
|
|
1750 |
test_K_SubstringBeforeFunc_8
|
|
1751 |
|
|
1752 |
| query result |
|
|
1753 |
|
|
1754 |
query := '
|
|
1755 |
(:*******************************************************:)
|
|
1756 |
(: Test: K-SubstringBeforeFunc-8 :)
|
|
1757 |
(: Written by: Frans Englich :)
|
|
1758 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1759 |
(: Purpose: A test whose essence is: `substring-before((), ()) eq ""`. :)
|
|
1760 |
(:*******************************************************:)
|
|
1761 |
substring-before((), ()) eq ""
|
|
1762 |
'.
|
|
1763 |
|
|
1764 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1765 |
|
|
1766 |
|
|
1767 |
result := interpreter evaluate: query.
|
|
1768 |
self
|
|
1769 |
assert: (self xqtsResultTextFromResult: result)
|
|
1770 |
= (self xqtsResultTextFromFile:
|
|
1771 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/K-SubstringBeforeFunc-8.txt')
|
|
1772 |
|
|
1773 |
"Created: / 12-05-2013 / 08:11:51 / houzvjir@fel.cvut.cz"
|
|
1774 |
!
|
|
1775 |
|
|
1776 |
test_K_SubstringBeforeFunc_9
|
|
1777 |
|
|
1778 |
| query result |
|
|
1779 |
|
|
1780 |
query := '
|
|
1781 |
(:*******************************************************:)
|
|
1782 |
(: Test: K-SubstringBeforeFunc-9 :)
|
|
1783 |
(: Written by: Frans Englich :)
|
|
1784 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1785 |
(: Purpose: A test whose essence is: `substring-before("a string", "") eq ""`. :)
|
|
1786 |
(:*******************************************************:)
|
|
1787 |
substring-before("a string", "") eq ""
|
|
1788 |
'.
|
|
1789 |
|
|
1790 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1791 |
|
|
1792 |
|
|
1793 |
result := interpreter evaluate: query.
|
|
1794 |
self
|
|
1795 |
assert: (self xqtsResultTextFromResult: result)
|
|
1796 |
= (self xqtsResultTextFromFile:
|
|
1797 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/K-SubstringBeforeFunc-9.txt')
|
|
1798 |
|
|
1799 |
"Created: / 12-05-2013 / 08:12:18 / houzvjir@fel.cvut.cz"
|
|
1800 |
!
|
|
1801 |
|
|
1802 |
test_K_SubstringFunc_1
|
|
1803 |
|
|
1804 |
| query result |
|
|
1805 |
|
|
1806 |
query := '
|
|
1807 |
(:*******************************************************:)
|
|
1808 |
(: Test: K-SubstringFunc-1 :)
|
|
1809 |
(: Written by: Frans Englich :)
|
|
1810 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1811 |
(: Purpose: A test whose essence is: `sub-string("a string")`. :)
|
|
1812 |
(:*******************************************************:)
|
|
1813 |
sub-string("a string")
|
|
1814 |
'.
|
|
1815 |
|
|
1816 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1817 |
|
|
1818 |
|
|
1819 |
result := interpreter evaluate: query.
|
|
1820 |
self
|
|
1821 |
assert: (self xqtsResultTextFromResult: result)
|
|
1822 |
= (self xqtsResultTextFromFile:
|
|
1823 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-1.txt')
|
|
1824 |
|
|
1825 |
"Created: / 11-05-2013 / 22:19:59 / houzvjir@fel.cvut.cz"
|
|
1826 |
!
|
|
1827 |
|
|
1828 |
test_K_SubstringFunc_10
|
|
1829 |
|
|
1830 |
| query result |
|
|
1831 |
|
|
1832 |
query := '
|
|
1833 |
(:*******************************************************:)
|
|
1834 |
(: Test: K-SubstringFunc-10 :)
|
|
1835 |
(: Written by: Frans Englich :)
|
|
1836 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1837 |
(: Purpose: A test whose essence is: `substring("12345", 0 div 0E0, 3) eq ""`. :)
|
|
1838 |
(:*******************************************************:)
|
|
1839 |
substring("12345", 0 div 0E0, 3) eq ""
|
|
1840 |
'.
|
|
1841 |
|
|
1842 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1843 |
|
|
1844 |
|
|
1845 |
result := interpreter evaluate: query.
|
|
1846 |
self
|
|
1847 |
assert: (self xqtsResultTextFromResult: result)
|
|
1848 |
= (self xqtsResultTextFromFile:
|
|
1849 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-10.txt')
|
|
1850 |
|
|
1851 |
"Created: / 11-05-2013 / 22:27:49 / houzvjir@fel.cvut.cz"
|
|
1852 |
!
|
|
1853 |
|
|
1854 |
test_K_SubstringFunc_11
|
|
1855 |
|
|
1856 |
| query result |
|
|
1857 |
|
|
1858 |
query := '
|
|
1859 |
(:*******************************************************:)
|
|
1860 |
(: Test: K-SubstringFunc-11 :)
|
|
1861 |
(: Written by: Frans Englich :)
|
|
1862 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1863 |
(: Purpose: A test whose essence is: `substring("12345", 1, 0 div 0E0) eq ""`. :)
|
|
1864 |
(:*******************************************************:)
|
|
1865 |
substring("12345", 1, 0 div 0E0) eq ""
|
|
1866 |
'.
|
|
1867 |
|
|
1868 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1869 |
|
|
1870 |
|
|
1871 |
result := interpreter evaluate: query.
|
|
1872 |
self
|
|
1873 |
assert: (self xqtsResultTextFromResult: result)
|
|
1874 |
= (self xqtsResultTextFromFile:
|
|
1875 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-11.txt')
|
|
1876 |
|
|
1877 |
"Created: / 11-05-2013 / 22:28:13 / houzvjir@fel.cvut.cz"
|
|
1878 |
!
|
|
1879 |
|
|
1880 |
test_K_SubstringFunc_12
|
|
1881 |
|
|
1882 |
| query result |
|
|
1883 |
|
|
1884 |
query := '
|
|
1885 |
(:*******************************************************:)
|
|
1886 |
(: Test: K-SubstringFunc-12 :)
|
|
1887 |
(: Written by: Frans Englich :)
|
|
1888 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1889 |
(: Purpose: A test whose essence is: `substring("12345", -3, 5) eq "1"`. :)
|
|
1890 |
(:*******************************************************:)
|
|
1891 |
substring("12345", -3, 5) eq "1"
|
|
1892 |
'.
|
|
1893 |
|
|
1894 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1895 |
|
|
1896 |
|
|
1897 |
result := interpreter evaluate: query.
|
|
1898 |
self
|
|
1899 |
assert: (self xqtsResultTextFromResult: result)
|
|
1900 |
= (self xqtsResultTextFromFile:
|
|
1901 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-12.txt')
|
|
1902 |
|
|
1903 |
"Created: / 11-05-2013 / 22:28:46 / houzvjir@fel.cvut.cz"
|
|
1904 |
!
|
|
1905 |
|
|
1906 |
test_K_SubstringFunc_13
|
|
1907 |
|
|
1908 |
| query result |
|
|
1909 |
|
|
1910 |
query := '
|
|
1911 |
(:*******************************************************:)
|
|
1912 |
(: Test: K-SubstringFunc-13 :)
|
|
1913 |
(: Written by: Frans Englich :)
|
|
1914 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1915 |
(: Purpose: A test whose essence is: `substring("12345", -42, 1 div 0E0) eq "12345"`. :)
|
|
1916 |
(:*******************************************************:)
|
|
1917 |
substring("12345", -42, 1 div 0E0) eq "12345"
|
|
1918 |
'.
|
|
1919 |
|
|
1920 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1921 |
|
|
1922 |
|
|
1923 |
result := interpreter evaluate: query.
|
|
1924 |
self
|
|
1925 |
assert: (self xqtsResultTextFromResult: result)
|
|
1926 |
= (self xqtsResultTextFromFile:
|
|
1927 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-13.txt')
|
|
1928 |
|
|
1929 |
"Created: / 11-05-2013 / 22:29:18 / houzvjir@fel.cvut.cz"
|
|
1930 |
!
|
|
1931 |
|
|
1932 |
test_K_SubstringFunc_14
|
|
1933 |
|
|
1934 |
| query result |
|
|
1935 |
|
|
1936 |
query := '
|
|
1937 |
(:*******************************************************:)
|
|
1938 |
(: Test: K-SubstringFunc-14 :)
|
|
1939 |
(: Written by: Frans Englich :)
|
|
1940 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1941 |
(: Purpose: A test whose essence is: `substring("12345", -1 div 0E0, 1 div 0E0) eq ""`. :)
|
|
1942 |
(:*******************************************************:)
|
|
1943 |
substring("12345", -1 div 0E0, 1 div 0E0) eq ""
|
|
1944 |
'.
|
|
1945 |
|
|
1946 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1947 |
|
|
1948 |
|
|
1949 |
result := interpreter evaluate: query.
|
|
1950 |
self
|
|
1951 |
assert: (self xqtsResultTextFromResult: result)
|
|
1952 |
= (self xqtsResultTextFromFile:
|
|
1953 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-14.txt')
|
|
1954 |
|
|
1955 |
"Created: / 11-05-2013 / 22:29:44 / houzvjir@fel.cvut.cz"
|
|
1956 |
!
|
|
1957 |
|
|
1958 |
test_K_SubstringFunc_15
|
|
1959 |
|
|
1960 |
| query result |
|
|
1961 |
|
|
1962 |
query := '
|
|
1963 |
(:*******************************************************:)
|
|
1964 |
(: Test: K-SubstringFunc-15 :)
|
|
1965 |
(: Written by: Frans Englich :)
|
|
1966 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1967 |
(: Purpose: A test whose essence is: `substring("12345", 5, -3) eq ""`. :)
|
|
1968 |
(:*******************************************************:)
|
|
1969 |
substring("12345", 5, -3) eq ""
|
|
1970 |
'.
|
|
1971 |
|
|
1972 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1973 |
|
|
1974 |
|
|
1975 |
result := interpreter evaluate: query.
|
|
1976 |
self
|
|
1977 |
assert: (self xqtsResultTextFromResult: result)
|
|
1978 |
= (self xqtsResultTextFromFile:
|
|
1979 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-15.txt')
|
|
1980 |
|
|
1981 |
"Created: / 11-05-2013 / 22:30:09 / houzvjir@fel.cvut.cz"
|
|
1982 |
!
|
|
1983 |
|
|
1984 |
test_K_SubstringFunc_2
|
|
1985 |
|
|
1986 |
| query result |
|
|
1987 |
|
|
1988 |
query := '
|
|
1989 |
(:*******************************************************:)
|
|
1990 |
(: Test: K-SubstringFunc-2 :)
|
|
1991 |
(: Written by: Frans Englich :)
|
|
1992 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
1993 |
(: Purpose: A test whose essence is: `sub-string("a string", 1, 2, "wrong param")`. :)
|
|
1994 |
(:*******************************************************:)
|
|
1995 |
sub-string("a string", 1, 2, "wrong param")
|
|
1996 |
'.
|
|
1997 |
|
|
1998 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
1999 |
|
|
2000 |
|
|
2001 |
result := interpreter evaluate: query.
|
|
2002 |
self
|
|
2003 |
assert: (self xqtsResultTextFromResult: result)
|
|
2004 |
= (self xqtsResultTextFromFile:
|
|
2005 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-2.txt')
|
|
2006 |
|
|
2007 |
"Created: / 11-05-2013 / 22:21:40 / houzvjir@fel.cvut.cz"
|
|
2008 |
!
|
|
2009 |
|
|
2010 |
test_K_SubstringFunc_3
|
|
2011 |
|
|
2012 |
| query result |
|
|
2013 |
|
|
2014 |
query := '
|
|
2015 |
(:*******************************************************:)
|
|
2016 |
(: Test: K-SubstringFunc-3 :)
|
|
2017 |
(: Written by: Frans Englich :)
|
|
2018 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2019 |
(: Purpose: A test whose essence is: `substring((), 1, 2) eq ""`. :)
|
|
2020 |
(:*******************************************************:)
|
|
2021 |
substring((), 1, 2) eq ""
|
|
2022 |
'.
|
|
2023 |
|
|
2024 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2025 |
|
|
2026 |
|
|
2027 |
result := interpreter evaluate: query.
|
|
2028 |
self
|
|
2029 |
assert: (self xqtsResultTextFromResult: result)
|
|
2030 |
= (self xqtsResultTextFromFile:
|
|
2031 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-3.txt')
|
|
2032 |
|
|
2033 |
"Created: / 11-05-2013 / 22:21:59 / houzvjir@fel.cvut.cz"
|
|
2034 |
!
|
|
2035 |
|
|
2036 |
test_K_SubstringFunc_4
|
|
2037 |
|
|
2038 |
| query result |
|
|
2039 |
|
|
2040 |
query := '
|
|
2041 |
(:*******************************************************:)
|
|
2042 |
(: Test: K-SubstringFunc-4 :)
|
|
2043 |
(: Written by: Frans Englich :)
|
|
2044 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2045 |
(: Purpose: A test whose essence is: `substring((), 1) eq ""`. :)
|
|
2046 |
(:*******************************************************:)
|
|
2047 |
substring((), 1) eq ""
|
|
2048 |
'.
|
|
2049 |
|
|
2050 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2051 |
|
|
2052 |
|
|
2053 |
result := interpreter evaluate: query.
|
|
2054 |
self
|
|
2055 |
assert: (self xqtsResultTextFromResult: result)
|
|
2056 |
= (self xqtsResultTextFromFile:
|
|
2057 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-4.txt')
|
|
2058 |
|
|
2059 |
"Created: / 11-05-2013 / 22:24:07 / houzvjir@fel.cvut.cz"
|
|
2060 |
!
|
|
2061 |
|
|
2062 |
test_K_SubstringFunc_5
|
|
2063 |
|
|
2064 |
| query result |
|
|
2065 |
|
|
2066 |
query := '
|
|
2067 |
(:*******************************************************:)
|
|
2068 |
(: Test: K-SubstringFunc-5 :)
|
|
2069 |
(: Written by: Frans Englich :)
|
|
2070 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2071 |
(: Purpose: A test whose essence is: `substring("12345", 1.5, 2.6) eq "234"`. :)
|
|
2072 |
(:*******************************************************:)
|
|
2073 |
substring("12345", 1.5, 2.6) eq "234"
|
|
2074 |
'.
|
|
2075 |
|
|
2076 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2077 |
|
|
2078 |
|
|
2079 |
result := interpreter evaluate: query.
|
|
2080 |
self
|
|
2081 |
assert: (self xqtsResultTextFromResult: result)
|
|
2082 |
= (self xqtsResultTextFromFile:
|
|
2083 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-5.txt')
|
|
2084 |
|
|
2085 |
"Created: / 11-05-2013 / 22:24:30 / houzvjir@fel.cvut.cz"
|
|
2086 |
!
|
|
2087 |
|
|
2088 |
test_K_SubstringFunc_6
|
|
2089 |
|
|
2090 |
| query result |
|
|
2091 |
|
|
2092 |
query := '
|
|
2093 |
(:*******************************************************:)
|
|
2094 |
(: Test: K-SubstringFunc-6 :)
|
|
2095 |
(: Written by: Frans Englich :)
|
|
2096 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2097 |
(: Purpose: A test whose essence is: `substring((), 1, 3) eq ""`. :)
|
|
2098 |
(:*******************************************************:)
|
|
2099 |
substring((), 1, 3) eq ""
|
|
2100 |
'.
|
|
2101 |
|
|
2102 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2103 |
|
|
2104 |
|
|
2105 |
result := interpreter evaluate: query.
|
|
2106 |
self
|
|
2107 |
assert: (self xqtsResultTextFromResult: result)
|
|
2108 |
= (self xqtsResultTextFromFile:
|
|
2109 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-6.txt')
|
|
2110 |
|
|
2111 |
"Created: / 11-05-2013 / 22:25:00 / houzvjir@fel.cvut.cz"
|
|
2112 |
!
|
|
2113 |
|
|
2114 |
test_K_SubstringFunc_7
|
|
2115 |
|
|
2116 |
| query result |
|
|
2117 |
|
|
2118 |
query := '
|
|
2119 |
(:*******************************************************:)
|
|
2120 |
(: Test: K-SubstringFunc-7 :)
|
|
2121 |
(: Written by: Frans Englich :)
|
|
2122 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2123 |
(: Purpose: A test whose essence is: `substring("motor car", 6) eq " car"`. :)
|
|
2124 |
(:*******************************************************:)
|
|
2125 |
substring("motor car", 6) eq " car"
|
|
2126 |
'.
|
|
2127 |
|
|
2128 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2129 |
|
|
2130 |
|
|
2131 |
result := interpreter evaluate: query.
|
|
2132 |
self
|
|
2133 |
assert: (self xqtsResultTextFromResult: result)
|
|
2134 |
= (self xqtsResultTextFromFile:
|
|
2135 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-7.txt')
|
|
2136 |
|
|
2137 |
"Created: / 11-05-2013 / 22:25:37 / houzvjir@fel.cvut.cz"
|
|
2138 |
!
|
|
2139 |
|
|
2140 |
test_K_SubstringFunc_8
|
|
2141 |
|
|
2142 |
| query result |
|
|
2143 |
|
|
2144 |
query := '
|
|
2145 |
(:*******************************************************:)
|
|
2146 |
(: Test: K-SubstringFunc-8 :)
|
|
2147 |
(: Written by: Frans Englich :)
|
|
2148 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2149 |
(: Purpose: A test whose essence is: `substring("12345", 0, 3) eq "12"`. :)
|
|
2150 |
(:*******************************************************:)
|
|
2151 |
substring("12345", 0, 3) eq "12"
|
|
2152 |
'.
|
|
2153 |
|
|
2154 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2155 |
|
|
2156 |
|
|
2157 |
result := interpreter evaluate: query.
|
|
2158 |
self
|
|
2159 |
assert: (self xqtsResultTextFromResult: result)
|
|
2160 |
= (self xqtsResultTextFromFile:
|
|
2161 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-8.txt')
|
|
2162 |
|
|
2163 |
"Created: / 11-05-2013 / 22:26:01 / houzvjir@fel.cvut.cz"
|
|
2164 |
!
|
|
2165 |
|
|
2166 |
test_K_SubstringFunc_9
|
|
2167 |
|
|
2168 |
| query result |
|
|
2169 |
|
|
2170 |
query := '
|
|
2171 |
(:*******************************************************:)
|
|
2172 |
(: Test: K-SubstringFunc-9 :)
|
|
2173 |
(: Written by: Frans Englich :)
|
|
2174 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2175 |
(: Purpose: A test whose essence is: `substring("metadata", 4, 3) eq "ada"`. :)
|
|
2176 |
(:*******************************************************:)
|
|
2177 |
substring("metadata", 4, 3) eq "ada"
|
|
2178 |
'.
|
|
2179 |
|
|
2180 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2181 |
|
|
2182 |
|
|
2183 |
result := interpreter evaluate: query.
|
|
2184 |
self
|
|
2185 |
assert: (self xqtsResultTextFromResult: result)
|
|
2186 |
= (self xqtsResultTextFromFile:
|
|
2187 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/K-SubstringFunc-9.txt')
|
|
2188 |
|
|
2189 |
"Created: / 11-05-2013 / 22:26:20 / houzvjir@fel.cvut.cz"
|
|
2190 |
!
|
|
2191 |
|
|
2192 |
test_K_TranslateFunc_1
|
|
2193 |
|
|
2194 |
| query result |
|
|
2195 |
|
|
2196 |
query := '
|
|
2197 |
(:*******************************************************:)
|
|
2198 |
(: Test: K-TranslateFunc-1 :)
|
|
2199 |
(: Written by: Frans Englich :)
|
|
2200 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2201 |
(: Purpose: A test whose essence is: `translate()`. :)
|
|
2202 |
(:*******************************************************:)
|
|
2203 |
translate()
|
|
2204 |
'.
|
|
2205 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2206 |
|
|
2207 |
|
|
2208 |
result := interpreter evaluate: query.
|
|
2209 |
self
|
|
2210 |
assert: (self xqtsResultTextFromResult: result)
|
|
2211 |
= (self xqtsResultTextFromFile:
|
|
2212 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/K-TranslateFunc-1.txt')
|
|
2213 |
|
|
2214 |
"Created: / 13-05-2013 / 13:56:24 / houzvjir@fel.cvut.cz"
|
|
2215 |
!
|
|
2216 |
|
|
2217 |
test_K_TranslateFunc_10
|
|
2218 |
|
|
2219 |
| query result |
|
|
2220 |
|
|
2221 |
query := '
|
|
2222 |
(:*******************************************************:)
|
|
2223 |
(: Test: K-TranslateFunc-10 :)
|
|
2224 |
(: Written by: Frans Englich :)
|
|
2225 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2226 |
(: Purpose: A test whose essence is: `translate("--aaa--","abc-","ABC") eq "AAA"`. :)
|
|
2227 |
(:*******************************************************:)
|
|
2228 |
translate("--aaa--","abc-","ABC") eq "AAA"
|
|
2229 |
'.
|
|
2230 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2231 |
|
|
2232 |
|
|
2233 |
result := interpreter evaluate: query.
|
|
2234 |
self
|
|
2235 |
assert: (self xqtsResultTextFromResult: result)
|
|
2236 |
= (self xqtsResultTextFromFile:
|
|
2237 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/K-TranslateFunc-10.txt')
|
|
2238 |
|
|
2239 |
"Created: / 13-05-2013 / 14:01:12 / houzvjir@fel.cvut.cz"
|
|
2240 |
!
|
|
2241 |
|
|
2242 |
test_K_TranslateFunc_2
|
|
2243 |
|
|
2244 |
| query result |
|
|
2245 |
|
|
2246 |
query := '
|
|
2247 |
(:*******************************************************:)
|
|
2248 |
(: Test: K-TranslateFunc-2 :)
|
|
2249 |
(: Written by: Frans Englich :)
|
|
2250 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2251 |
(: Purpose: A test whose essence is: `translate("string", "map string")`. :)
|
|
2252 |
(:*******************************************************:)
|
|
2253 |
translate("string", "map string")
|
|
2254 |
'.
|
|
2255 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2256 |
|
|
2257 |
|
|
2258 |
result := interpreter evaluate: query.
|
|
2259 |
self
|
|
2260 |
assert: (self xqtsResultTextFromResult: result)
|
|
2261 |
= (self xqtsResultTextFromFile:
|
|
2262 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/K-TranslateFunc-2.txt')
|
|
2263 |
|
|
2264 |
"Created: / 13-05-2013 / 13:57:18 / houzvjir@fel.cvut.cz"
|
|
2265 |
!
|
|
2266 |
|
|
2267 |
test_K_TranslateFunc_3
|
|
2268 |
|
|
2269 |
| query result |
|
|
2270 |
|
|
2271 |
query := '
|
|
2272 |
(:*******************************************************:)
|
|
2273 |
(: Test: K-TranslateFunc-3 :)
|
|
2274 |
(: Written by: Frans Englich :)
|
|
2275 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2276 |
(: Purpose: A test whose essence is: `translate("arg", "map string", "transString", "wrong param")`. :)
|
|
2277 |
(:*******************************************************:)
|
|
2278 |
translate("arg", "map string",
|
|
2279 |
"transString", "wrong param")
|
|
2280 |
'.
|
|
2281 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2282 |
|
|
2283 |
|
|
2284 |
result := interpreter evaluate: query.
|
|
2285 |
self
|
|
2286 |
assert: (self xqtsResultTextFromResult: result)
|
|
2287 |
= (self xqtsResultTextFromFile:
|
|
2288 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/K-TranslateFunc-3.txt')
|
|
2289 |
|
|
2290 |
"Created: / 13-05-2013 / 13:57:42 / houzvjir@fel.cvut.cz"
|
|
2291 |
!
|
|
2292 |
|
|
2293 |
test_K_TranslateFunc_4
|
|
2294 |
|
|
2295 |
| query result |
|
|
2296 |
|
|
2297 |
query := '
|
|
2298 |
(:*******************************************************:)
|
|
2299 |
(: Test: K-TranslateFunc-4 :)
|
|
2300 |
(: Written by: Frans Englich :)
|
|
2301 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2302 |
(: Purpose: A test whose essence is: `translate("--aaa--","-","") eq "aaa"`. :)
|
|
2303 |
(:*******************************************************:)
|
|
2304 |
translate("--aaa--","-","") eq "aaa"
|
|
2305 |
'.
|
|
2306 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2307 |
|
|
2308 |
|
|
2309 |
result := interpreter evaluate: query.
|
|
2310 |
self
|
|
2311 |
assert: (self xqtsResultTextFromResult: result)
|
|
2312 |
= (self xqtsResultTextFromFile:
|
|
2313 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/K-TranslateFunc-4.txt')
|
|
2314 |
|
|
2315 |
"Created: / 13-05-2013 / 13:58:13 / houzvjir@fel.cvut.cz"
|
|
2316 |
!
|
|
2317 |
|
|
2318 |
test_K_TranslateFunc_5
|
|
2319 |
|
|
2320 |
| query result |
|
|
2321 |
|
|
2322 |
query := '
|
|
2323 |
(:*******************************************************:)
|
|
2324 |
(: Test: K-TranslateFunc-5 :)
|
|
2325 |
(: Written by: Frans Englich :)
|
|
2326 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2327 |
(: Purpose: A test whose essence is: `translate("--aaa--","bbb++","") eq "--aaa--"`. :)
|
|
2328 |
(:*******************************************************:)
|
|
2329 |
translate("--aaa--","bbb++","") eq "--aaa--"
|
|
2330 |
'.
|
|
2331 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2332 |
|
|
2333 |
|
|
2334 |
result := interpreter evaluate: query.
|
|
2335 |
self
|
|
2336 |
assert: (self xqtsResultTextFromResult: result)
|
|
2337 |
= (self xqtsResultTextFromFile:
|
|
2338 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/K-TranslateFunc-5.txt')
|
|
2339 |
|
|
2340 |
"Created: / 13-05-2013 / 13:58:38 / houzvjir@fel.cvut.cz"
|
|
2341 |
!
|
|
2342 |
|
|
2343 |
test_K_TranslateFunc_6
|
|
2344 |
|
|
2345 |
| query result |
|
|
2346 |
|
|
2347 |
query := '
|
|
2348 |
(:*******************************************************:)
|
|
2349 |
(: Test: K-TranslateFunc-6 :)
|
|
2350 |
(: Written by: Frans Englich :)
|
|
2351 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2352 |
(: Purpose: A test whose essence is: `translate("argstr", "", "matrs") eq "argstr"`. :)
|
|
2353 |
(:*******************************************************:)
|
|
2354 |
translate("argstr", "", "matrs") eq "argstr"
|
|
2355 |
'.
|
|
2356 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2357 |
|
|
2358 |
|
|
2359 |
result := interpreter evaluate: query.
|
|
2360 |
self
|
|
2361 |
assert: (self xqtsResultTextFromResult: result)
|
|
2362 |
= (self xqtsResultTextFromFile:
|
|
2363 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/K-TranslateFunc-6.txt')
|
|
2364 |
|
|
2365 |
"Created: / 13-05-2013 / 13:58:57 / houzvjir@fel.cvut.cz"
|
|
2366 |
!
|
|
2367 |
|
|
2368 |
test_K_TranslateFunc_7
|
|
2369 |
|
|
2370 |
| query result |
|
|
2371 |
|
|
2372 |
query := '
|
|
2373 |
(:*******************************************************:)
|
|
2374 |
(: Test: K-TranslateFunc-7 :)
|
|
2375 |
(: Written by: Frans Englich :)
|
|
2376 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2377 |
(: Purpose: A test whose essence is: `translate((), "map", "trans") eq ""`. :)
|
|
2378 |
(:*******************************************************:)
|
|
2379 |
translate((), "map", "trans") eq ""
|
|
2380 |
'.
|
|
2381 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2382 |
|
|
2383 |
|
|
2384 |
result := interpreter evaluate: query.
|
|
2385 |
self
|
|
2386 |
assert: (self xqtsResultTextFromResult: result)
|
|
2387 |
= (self xqtsResultTextFromFile:
|
|
2388 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/K-TranslateFunc-7.txt')
|
|
2389 |
|
|
2390 |
"Created: / 13-05-2013 / 13:59:17 / houzvjir@fel.cvut.cz"
|
|
2391 |
!
|
|
2392 |
|
|
2393 |
test_K_TranslateFunc_8
|
|
2394 |
|
|
2395 |
| query result |
|
|
2396 |
|
|
2397 |
query := '
|
|
2398 |
(:*******************************************************:)
|
|
2399 |
(: Test: K-TranslateFunc-8 :)
|
|
2400 |
(: Written by: Frans Englich :)
|
|
2401 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2402 |
(: Purpose: A test whose essence is: `translate("abcdabc", "abc", "AB") eq "ABdAB"`. :)
|
|
2403 |
(:*******************************************************:)
|
|
2404 |
translate("abcdabc", "abc", "AB") eq "ABdAB"
|
|
2405 |
'.
|
|
2406 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2407 |
|
|
2408 |
|
|
2409 |
result := interpreter evaluate: query.
|
|
2410 |
self
|
|
2411 |
assert: (self xqtsResultTextFromResult: result)
|
|
2412 |
= (self xqtsResultTextFromFile:
|
|
2413 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/K-TranslateFunc-8.txt')
|
|
2414 |
|
|
2415 |
"Created: / 13-05-2013 / 13:59:48 / houzvjir@fel.cvut.cz"
|
|
2416 |
!
|
|
2417 |
|
|
2418 |
test_K_TranslateFunc_9
|
|
2419 |
|
|
2420 |
| query result |
|
|
2421 |
|
|
2422 |
query := '
|
|
2423 |
(:*******************************************************:)
|
|
2424 |
(: Test: K-TranslateFunc-9 :)
|
|
2425 |
(: Written by: Frans Englich :)
|
|
2426 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2427 |
(: Purpose: A test whose essence is: `translate("bar","abc","ABC") eq "BAr"`. :)
|
|
2428 |
(:*******************************************************:)
|
|
2429 |
translate("bar","abc","ABC") eq "BAr"
|
|
2430 |
'.
|
|
2431 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2432 |
|
|
2433 |
|
|
2434 |
result := interpreter evaluate: query.
|
|
2435 |
self
|
|
2436 |
assert: (self xqtsResultTextFromResult: result)
|
|
2437 |
= (self xqtsResultTextFromFile:
|
|
2438 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/K-TranslateFunc-9.txt')
|
|
2439 |
|
|
2440 |
"Created: / 13-05-2013 / 14:00:07 / houzvjir@fel.cvut.cz"
|
|
2441 |
!
|
|
2442 |
|
|
2443 |
test_K_UpperCaseFunc_1
|
|
2444 |
|
|
2445 |
| query result |
|
|
2446 |
|
|
2447 |
query := '
|
|
2448 |
(: Name: fn-upper-case-1 :)
|
|
2449 |
(: Description: Evaluation of upper-case function as per example 1 (for this function) :)
|
|
2450 |
(: from the F&O specs. :)
|
|
2451 |
|
|
2452 |
fn:upper-case("ABc!!D")
|
|
2453 |
'.
|
|
2454 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2455 |
|
|
2456 |
|
|
2457 |
result := interpreter evaluate: query.
|
|
2458 |
self
|
|
2459 |
assert: (self xqtsResultTextFromResult: result)
|
|
2460 |
= (self xqtsResultTextFromFile:
|
|
2461 |
'Functions/AllStringFunc/GeneralStringFunc/UppeerCaseFunc/K-UpperCaseFunc-1.txt')
|
|
2462 |
|
|
2463 |
"Created: / 11-05-2013 / 19:21:04 / jirka"
|
|
2464 |
!
|
|
2465 |
|
|
2466 |
test_K_UpperCaseFunc_2
|
|
2467 |
|
|
2468 |
| query result |
|
|
2469 |
|
|
2470 |
query := '
|
|
2471 |
(:*******************************************************:)
|
|
2472 |
(: Test: K-UpperCaseFunc-2 :)
|
|
2473 |
(: Written by: Frans Englich :)
|
|
2474 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2475 |
(: Purpose: A test whose essence is: `upper-case("string", "wrong param")`. :)
|
|
2476 |
(:*******************************************************:)
|
|
2477 |
upper-case("string", "wrong param")
|
|
2478 |
'.
|
|
2479 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2480 |
|
|
2481 |
|
|
2482 |
result := interpreter evaluate: query.
|
|
2483 |
self
|
|
2484 |
assert: (self xqtsResultTextFromResult: result)
|
|
2485 |
= (self xqtsResultTextFromFile:
|
|
2486 |
'Functions/AllStringFunc/GeneralStringFunc/UppeerCaseFunc/K-UpperCaseFunc-2.txt')
|
|
2487 |
|
|
2488 |
"Created: / 11-05-2013 / 22:13:02 / houzvjir@fel.cvut.cz"
|
|
2489 |
!
|
|
2490 |
|
|
2491 |
test_K_UpperCaseFunc_3
|
|
2492 |
|
|
2493 |
| query result |
|
|
2494 |
|
|
2495 |
query := '
|
|
2496 |
(:*******************************************************:)
|
|
2497 |
(: Test: K-UpperCaseFunc-3 :)
|
|
2498 |
(: Written by: Frans Englich :)
|
|
2499 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2500 |
(: Purpose: A test whose essence is: `upper-case(()) eq ""`. :)
|
|
2501 |
(:*******************************************************:)
|
|
2502 |
upper-case(()) eq ""
|
|
2503 |
'.
|
|
2504 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2505 |
|
|
2506 |
|
|
2507 |
result := interpreter evaluate: query.
|
|
2508 |
self
|
|
2509 |
assert: (self xqtsResultTextFromResult: result)
|
|
2510 |
= (self xqtsResultTextFromFile:
|
|
2511 |
'Functions/AllStringFunc/GeneralStringFunc/UppeerCaseFunc/K-UpperCaseFunc-3.txt')
|
|
2512 |
|
|
2513 |
"Created: / 11-05-2013 / 22:14:15 / houzvjir@fel.cvut.cz"
|
|
2514 |
!
|
|
2515 |
|
|
2516 |
test_K_UpperCaseFunc_4
|
|
2517 |
|
|
2518 |
| query result |
|
|
2519 |
|
|
2520 |
query := '
|
|
2521 |
(:*******************************************************:)
|
|
2522 |
(: Test: K-UpperCaseFunc-4 :)
|
|
2523 |
(: Written by: Frans Englich :)
|
|
2524 |
(: Date: 2007-11-22T11:31:22+01:00 :)
|
|
2525 |
(: Purpose: A test whose essence is: `lower-case("ABc!!D") eq "abc!!d"`. :)
|
|
2526 |
(:*******************************************************:)
|
|
2527 |
lower-case("ABc!!D") eq "abc!!d"
|
|
2528 |
'.
|
|
2529 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2530 |
|
|
2531 |
|
|
2532 |
result := interpreter evaluate: query.
|
|
2533 |
self
|
|
2534 |
assert: (self xqtsResultTextFromResult: result)
|
|
2535 |
= (self xqtsResultTextFromFile:
|
|
2536 |
'Functions/AllStringFunc/GeneralStringFunc/UppeerCaseFunc/K-UpperCaseFunc-4.txt')
|
|
2537 |
|
|
2538 |
"Created: / 11-05-2013 / 22:14:38 / houzvjir@fel.cvut.cz"
|
|
2539 |
!
|
|
2540 |
|
|
2541 |
test_fn_ends_with2args_1
|
|
2542 |
|
|
2543 |
| query result |
|
|
2544 |
|
|
2545 |
query := '
|
|
2546 |
(:*******************************************************:)
|
|
2547 |
(:Test: ends-with2args-1 :)
|
|
2548 |
(:Written By: Carmelo Montanez :)
|
|
2549 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
2550 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2551 |
(: with the arguments set as follows: :)
|
|
2552 |
(:$arg1 = xs:string(lower bound) :)
|
|
2553 |
(:$arg2 = xs:string(lower bound) :)
|
|
2554 |
(:*******************************************************:)
|
|
2555 |
|
|
2556 |
fn:ends-with(xs:string("This is a characte"),xs:string("This is a characte"))
|
|
2557 |
'.
|
|
2558 |
|
|
2559 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2560 |
|
|
2561 |
|
|
2562 |
result := interpreter evaluate: query.
|
|
2563 |
self
|
|
2564 |
assert: (self xqtsResultTextFromResult: result)
|
|
2565 |
= (self xqtsResultTextFromFile:
|
|
2566 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with2args-1.txt')
|
|
2567 |
|
|
2568 |
"Created: / 11-05-2013 / 22:35:13 / houzvjir@fel.cvut.cz"
|
|
2569 |
!
|
|
2570 |
|
|
2571 |
test_fn_ends_with2args_2
|
|
2572 |
|
|
2573 |
| query result |
|
|
2574 |
|
|
2575 |
query := '
|
|
2576 |
(:*******************************************************:)
|
|
2577 |
(:Test: ends-with2args-2 :)
|
|
2578 |
(:Written By: Carmelo Montanez :)
|
|
2579 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
2580 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2581 |
(: with the arguments set as follows: :)
|
|
2582 |
(:$arg1 = xs:string(mid range) :)
|
|
2583 |
(:$arg2 = xs:string(lower bound) :)
|
|
2584 |
(:*******************************************************:)
|
|
2585 |
|
|
2586 |
fn:ends-with(xs:string("This is a characte"),xs:string("This is a characte"))
|
|
2587 |
'.
|
|
2588 |
|
|
2589 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2590 |
|
|
2591 |
|
|
2592 |
result := interpreter evaluate: query.
|
|
2593 |
self
|
|
2594 |
assert: (self xqtsResultTextFromResult: result)
|
|
2595 |
= (self xqtsResultTextFromFile:
|
|
2596 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with2args-2.txt')
|
|
2597 |
|
|
2598 |
"Created: / 11-05-2013 / 22:36:19 / houzvjir@fel.cvut.cz"
|
|
2599 |
!
|
|
2600 |
|
|
2601 |
test_fn_ends_with2args_3
|
|
2602 |
|
|
2603 |
| query result |
|
|
2604 |
|
|
2605 |
query := '
|
|
2606 |
(:*******************************************************:)
|
|
2607 |
(:Test: ends-with2args-3 :)
|
|
2608 |
(:Written By: Carmelo Montanez :)
|
|
2609 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
2610 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2611 |
(: with the arguments set as follows: :)
|
|
2612 |
(:$arg1 = xs:string(upper bound) :)
|
|
2613 |
(:$arg2 = xs:string(lower bound) :)
|
|
2614 |
(:*******************************************************:)
|
|
2615 |
|
|
2616 |
fn:ends-with(xs:string("This is a characte"),xs:string("This is a characte"))
|
|
2617 |
'.
|
|
2618 |
|
|
2619 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2620 |
|
|
2621 |
|
|
2622 |
result := interpreter evaluate: query.
|
|
2623 |
self
|
|
2624 |
assert: (self xqtsResultTextFromResult: result)
|
|
2625 |
= (self xqtsResultTextFromFile:
|
|
2626 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with2args-3.txt')
|
|
2627 |
|
|
2628 |
"Created: / 11-05-2013 / 22:36:55 / houzvjir@fel.cvut.cz"
|
|
2629 |
!
|
|
2630 |
|
|
2631 |
test_fn_ends_with2args_4
|
|
2632 |
|
|
2633 |
| query result |
|
|
2634 |
|
|
2635 |
query := '
|
|
2636 |
(:*******************************************************:)
|
|
2637 |
(:Test: ends-with2args-4 :)
|
|
2638 |
(:Written By: Carmelo Montanez :)
|
|
2639 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
2640 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2641 |
(: with the arguments set as follows: :)
|
|
2642 |
(:$arg1 = xs:string(lower bound) :)
|
|
2643 |
(:$arg2 = xs:string(mid range) :)
|
|
2644 |
(:*******************************************************:)
|
|
2645 |
|
|
2646 |
fn:ends-with(xs:string("This is a characte"),xs:string("This is a characte"))
|
|
2647 |
'.
|
|
2648 |
|
|
2649 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2650 |
|
|
2651 |
|
|
2652 |
result := interpreter evaluate: query.
|
|
2653 |
self
|
|
2654 |
assert: (self xqtsResultTextFromResult: result)
|
|
2655 |
= (self xqtsResultTextFromFile:
|
|
2656 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with2args-4.txt')
|
|
2657 |
|
|
2658 |
"Created: / 11-05-2013 / 22:37:23 / houzvjir@fel.cvut.cz"
|
|
2659 |
!
|
|
2660 |
|
|
2661 |
test_fn_ends_with2args_5
|
|
2662 |
|
|
2663 |
| query result |
|
|
2664 |
|
|
2665 |
query := '
|
|
2666 |
(:*******************************************************:)
|
|
2667 |
(:Test: ends-with2args-5 :)
|
|
2668 |
(:Written By: Carmelo Montanez :)
|
|
2669 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
2670 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2671 |
(: with the arguments set as follows: :)
|
|
2672 |
(:$arg1 = xs:string(lower bound) :)
|
|
2673 |
(:$arg2 = xs:string(upper bound) :)
|
|
2674 |
(:*******************************************************:)
|
|
2675 |
|
|
2676 |
fn:ends-with(xs:string("This is a characte"),xs:string("This is a characte"))
|
|
2677 |
'.
|
|
2678 |
|
|
2679 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2680 |
|
|
2681 |
|
|
2682 |
result := interpreter evaluate: query.
|
|
2683 |
self
|
|
2684 |
assert: (self xqtsResultTextFromResult: result)
|
|
2685 |
= (self xqtsResultTextFromFile:
|
|
2686 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with2args-5.txt')
|
|
2687 |
|
|
2688 |
"Created: / 11-05-2013 / 22:38:04 / houzvjir@fel.cvut.cz"
|
|
2689 |
!
|
|
2690 |
|
|
2691 |
test_fn_ends_with_1
|
|
2692 |
|
|
2693 |
| query result |
|
|
2694 |
|
|
2695 |
query := '
|
|
2696 |
(:*******************************************************:)
|
|
2697 |
(:Test: fn-ends-with-1 :)
|
|
2698 |
(:Written By: Carmelo Montanez :)
|
|
2699 |
(:Date: Fri May 27, 2005 :)
|
|
2700 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2701 |
(: with the arguments set as follows: :)
|
|
2702 |
(:$arg1 = "" :)
|
|
2703 |
(:$arg2 = "" :)
|
|
2704 |
(:*******************************************************:)
|
|
2705 |
|
|
2706 |
fn:ends-with("","")
|
|
2707 |
'.
|
|
2708 |
|
|
2709 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2710 |
|
|
2711 |
result := interpreter evaluate: query.
|
|
2712 |
self
|
|
2713 |
assert: (self xqtsResultTextFromResult: result)
|
|
2714 |
= (self xqtsResultTextFromFile:
|
|
2715 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-1.txt')
|
|
2716 |
|
|
2717 |
"Created: / 11-05-2013 / 19:21:47 / jirka"
|
|
2718 |
"Modified: / 18-05-2013 / 10:15:04 / houzvjir@fel.cvut.cz"
|
|
2719 |
!
|
|
2720 |
|
|
2721 |
test_fn_ends_with_10
|
|
2722 |
|
|
2723 |
| query result |
|
|
2724 |
|
|
2725 |
query := '
|
|
2726 |
(:*******************************************************:)
|
|
2727 |
(:Test: fn-ends-with-10 :)
|
|
2728 |
(:Written By: Carmelo Montanez :)
|
|
2729 |
(:Date: Fri May 27, 2005 :)
|
|
2730 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2731 |
(: with the arguments set as follows: :)
|
|
2732 |
(:$arg1 = " " :)
|
|
2733 |
(:$arg2 = " AAAAABBBBB" :)
|
|
2734 |
(:*******************************************************:)
|
|
2735 |
|
|
2736 |
fn:ends-with(" ","AAAAABBBBB")
|
|
2737 |
'.
|
|
2738 |
|
|
2739 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2740 |
|
|
2741 |
|
|
2742 |
result := interpreter evaluate: query.
|
|
2743 |
self
|
|
2744 |
assert: (self xqtsResultTextFromResult: result)
|
|
2745 |
= (self xqtsResultTextFromFile:
|
|
2746 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-10.txt')
|
|
2747 |
|
|
2748 |
"Created: / 11-05-2013 / 19:21:58 / jirka"
|
|
2749 |
!
|
|
2750 |
|
|
2751 |
test_fn_ends_with_11
|
|
2752 |
|
|
2753 |
| query result |
|
|
2754 |
|
|
2755 |
query := '
|
|
2756 |
(:*******************************************************:)
|
|
2757 |
(:Test: fn-ends-with-11 :)
|
|
2758 |
(:Written By: Carmelo Montanez :)
|
|
2759 |
(:Date: Fri May 27, 2005 :)
|
|
2760 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2761 |
(:using it as a argument of a fn:not - returns false :)
|
|
2762 |
(:*******************************************************:)
|
|
2763 |
|
|
2764 |
fn:not(fn:ends-with("A","A"))
|
|
2765 |
'.
|
|
2766 |
|
|
2767 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2768 |
|
|
2769 |
|
|
2770 |
result := interpreter evaluate: query.
|
|
2771 |
self
|
|
2772 |
assert: (self xqtsResultTextFromResult: result)
|
|
2773 |
= (self xqtsResultTextFromFile:
|
|
2774 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-11.txt')
|
|
2775 |
|
|
2776 |
"Created: / 11-05-2013 / 19:22:22 / jirka"
|
|
2777 |
!
|
|
2778 |
|
|
2779 |
test_fn_ends_with_12
|
|
2780 |
|
|
2781 |
| query result |
|
|
2782 |
|
|
2783 |
query := '
|
|
2784 |
(:*******************************************************:)
|
|
2785 |
(:Test: fn-ends-with-12 :)
|
|
2786 |
(:Written By: Carmelo Montanez :)
|
|
2787 |
(:Date: Fri May 27, 2005 :)
|
|
2788 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2789 |
(:using it as a argument of a fn:not - returns true :)
|
|
2790 |
(:*******************************************************:)
|
|
2791 |
|
|
2792 |
fn:not(fn:ends-with("A","B"))
|
|
2793 |
'.
|
|
2794 |
|
|
2795 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2796 |
|
|
2797 |
|
|
2798 |
result := interpreter evaluate: query.
|
|
2799 |
self
|
|
2800 |
assert: (self xqtsResultTextFromResult: result)
|
|
2801 |
= (self xqtsResultTextFromFile:
|
|
2802 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-12.txt')
|
|
2803 |
|
|
2804 |
"Created: / 11-05-2013 / 19:22:42 / jirka"
|
|
2805 |
!
|
|
2806 |
|
|
2807 |
test_fn_ends_with_13
|
|
2808 |
|
|
2809 |
| query result |
|
|
2810 |
|
|
2811 |
query := '
|
|
2812 |
(:*******************************************************:)
|
|
2813 |
(:Test: fn-ends-with-13 :)
|
|
2814 |
(:Written By: Carmelo Montanez :)
|
|
2815 |
(:Date: Fri May 27, 2005 :)
|
|
2816 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2817 |
(: with the arguments set as follows: :)
|
|
2818 |
(:$arg1 = xs:string("A") :)
|
|
2819 |
(:$arg2 = "A" :)
|
|
2820 |
(:*******************************************************:)
|
|
2821 |
|
|
2822 |
fn:ends-with(xs:string("A"),"A")
|
|
2823 |
'.
|
|
2824 |
|
|
2825 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2826 |
|
|
2827 |
|
|
2828 |
result := interpreter evaluate: query.
|
|
2829 |
self
|
|
2830 |
assert: (self xqtsResultTextFromResult: result)
|
|
2831 |
= (self xqtsResultTextFromFile:
|
|
2832 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-13.txt')
|
|
2833 |
|
|
2834 |
"Created: / 11-05-2013 / 19:22:57 / jirka"
|
|
2835 |
!
|
|
2836 |
|
|
2837 |
test_fn_ends_with_14
|
|
2838 |
|
|
2839 |
| query result |
|
|
2840 |
|
|
2841 |
query := '
|
|
2842 |
(:*******************************************************:)
|
|
2843 |
(:Test: fn-ends-with-14 :)
|
|
2844 |
(:Written By: Carmelo Montanez :)
|
|
2845 |
(:Date: Fri May 27, 2005 :)
|
|
2846 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2847 |
(: with the arguments set as follows: :)
|
|
2848 |
(:$arg1 = "A" :)
|
|
2849 |
(:$arg2 = xs:string("A") :)
|
|
2850 |
(:*******************************************************:)
|
|
2851 |
|
|
2852 |
fn:ends-with("A",xs:string("A"))
|
|
2853 |
'.
|
|
2854 |
|
|
2855 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2856 |
|
|
2857 |
|
|
2858 |
result := interpreter evaluate: query.
|
|
2859 |
self
|
|
2860 |
assert: (self xqtsResultTextFromResult: result)
|
|
2861 |
= (self xqtsResultTextFromFile:
|
|
2862 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-14.txt')
|
|
2863 |
|
|
2864 |
"Created: / 11-05-2013 / 19:23:10 / jirka"
|
|
2865 |
!
|
|
2866 |
|
|
2867 |
test_fn_ends_with_15
|
|
2868 |
|
|
2869 |
| query result |
|
|
2870 |
|
|
2871 |
query := '
|
|
2872 |
(:*******************************************************:)
|
|
2873 |
(:Test: fn-ends-with-15 :)
|
|
2874 |
(:Written By: Carmelo Montanez :)
|
|
2875 |
(:Date: Fri May 27, 2005 :)
|
|
2876 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2877 |
(: with the arguments set as follows: :)
|
|
2878 |
(:$arg1 = "A" :)
|
|
2879 |
(:$arg2 = "a" :)
|
|
2880 |
(:*******************************************************:)
|
|
2881 |
|
|
2882 |
fn:ends-with("A","a")
|
|
2883 |
'.
|
|
2884 |
|
|
2885 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2886 |
|
|
2887 |
|
|
2888 |
result := interpreter evaluate: query.
|
|
2889 |
self
|
|
2890 |
assert: (self xqtsResultTextFromResult: result)
|
|
2891 |
= (self xqtsResultTextFromFile:
|
|
2892 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-15.txt')
|
|
2893 |
|
|
2894 |
"Created: / 11-05-2013 / 19:23:20 / jirka"
|
|
2895 |
!
|
|
2896 |
|
|
2897 |
test_fn_ends_with_16
|
|
2898 |
|
|
2899 |
| query result |
|
|
2900 |
|
|
2901 |
query := '
|
|
2902 |
(:*******************************************************:)
|
|
2903 |
(:Test: fn-ends-with-16 :)
|
|
2904 |
(:Written By: Carmelo Montanez :)
|
|
2905 |
(:Date: Fri May 27, 2005 :)
|
|
2906 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2907 |
(: with the arguments set as follows: :)
|
|
2908 |
(:$arg1 = "a" :)
|
|
2909 |
(:$arg2 = "A" :)
|
|
2910 |
(:*******************************************************:)
|
|
2911 |
|
|
2912 |
fn:ends-with("a","A")
|
|
2913 |
'.
|
|
2914 |
|
|
2915 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2916 |
|
|
2917 |
|
|
2918 |
result := interpreter evaluate: query.
|
|
2919 |
self
|
|
2920 |
assert: (self xqtsResultTextFromResult: result)
|
|
2921 |
= (self xqtsResultTextFromFile:
|
|
2922 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-16.txt')
|
|
2923 |
|
|
2924 |
"Created: / 11-05-2013 / 19:23:37 / jirka"
|
|
2925 |
!
|
|
2926 |
|
|
2927 |
test_fn_ends_with_2
|
|
2928 |
|
|
2929 |
| query result |
|
|
2930 |
|
|
2931 |
query := '
|
|
2932 |
(:*******************************************************:)
|
|
2933 |
(:Test: fn-ends-with-2 :)
|
|
2934 |
(:Written By: Carmelo Montanez :)
|
|
2935 |
(:Date: Fri May 27, 2005 :)
|
|
2936 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2937 |
(: with the arguments set as follows: :)
|
|
2938 |
(:$arg1 = "" :)
|
|
2939 |
(:$arg2 = "A Character String" :)
|
|
2940 |
(:*******************************************************:)
|
|
2941 |
|
|
2942 |
fn:ends-with("","A Character String")
|
|
2943 |
'.
|
|
2944 |
|
|
2945 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2946 |
|
|
2947 |
result := interpreter evaluate: query.
|
|
2948 |
self
|
|
2949 |
assert: (self xqtsResultTextFromResult: result)
|
|
2950 |
= (self xqtsResultTextFromFile:
|
|
2951 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-2.txt')
|
|
2952 |
|
|
2953 |
"Created: / 11-05-2013 / 19:23:52 / jirka"
|
|
2954 |
"Modified: / 18-05-2013 / 13:22:13 / houzvjir@fel.cvut.cz"
|
|
2955 |
!
|
|
2956 |
|
|
2957 |
test_fn_ends_with_3
|
|
2958 |
|
|
2959 |
| query result |
|
|
2960 |
|
|
2961 |
query := '
|
|
2962 |
(:*******************************************************:)
|
|
2963 |
(:Test: fn-ends-with-3 :)
|
|
2964 |
(:Written By: Carmelo Montanez :)
|
|
2965 |
(:Date: Fri May 27, 2005 :)
|
|
2966 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2967 |
(: with the arguments set as follows: :)
|
|
2968 |
(:$arg1 = "" :)
|
|
2969 |
(:$arg2 = "A Character String" :)
|
|
2970 |
(:*******************************************************:)
|
|
2971 |
|
|
2972 |
fn:ends-with("A Character String","")
|
|
2973 |
'.
|
|
2974 |
|
|
2975 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
2976 |
|
|
2977 |
|
|
2978 |
result := interpreter evaluate: query.
|
|
2979 |
self
|
|
2980 |
assert: (self xqtsResultTextFromResult: result)
|
|
2981 |
= (self xqtsResultTextFromFile:
|
|
2982 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-3.txt')
|
|
2983 |
|
|
2984 |
"Created: / 11-05-2013 / 19:24:08 / jirka"
|
|
2985 |
!
|
|
2986 |
|
|
2987 |
test_fn_ends_with_4
|
|
2988 |
|
|
2989 |
| query result |
|
|
2990 |
|
|
2991 |
query := '
|
|
2992 |
(:*******************************************************:)
|
|
2993 |
(:Test: fn-ends-with-4 :)
|
|
2994 |
(:Written By: Carmelo Montanez :)
|
|
2995 |
(:Date: Fri May 27, 2005 :)
|
|
2996 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
2997 |
(: with the arguments set as follows: :)
|
|
2998 |
(:$arg1 = () :)
|
|
2999 |
(:$arg2 = "" :)
|
|
3000 |
(:*******************************************************:)
|
|
3001 |
|
|
3002 |
fn:ends-with((),"")
|
|
3003 |
'.
|
|
3004 |
|
|
3005 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3006 |
|
|
3007 |
|
|
3008 |
result := interpreter evaluate: query.
|
|
3009 |
self
|
|
3010 |
assert: (self xqtsResultTextFromResult: result)
|
|
3011 |
= (self xqtsResultTextFromFile:
|
|
3012 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-4.txt')
|
|
3013 |
|
|
3014 |
"Created: / 11-05-2013 / 19:24:29 / jirka"
|
|
3015 |
!
|
|
3016 |
|
|
3017 |
test_fn_ends_with_5
|
|
3018 |
|
|
3019 |
| query result |
|
|
3020 |
|
|
3021 |
query := '
|
|
3022 |
(:*******************************************************:)
|
|
3023 |
(:Test: fn-ends-with-5 :)
|
|
3024 |
(:Written By: Carmelo Montanez :)
|
|
3025 |
(:Date: Fri May 27, 2005 :)
|
|
3026 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
3027 |
(: with the arguments set as follows: :)
|
|
3028 |
(:$arg1 = "" :)
|
|
3029 |
(:$arg2 = () :)
|
|
3030 |
(:*******************************************************:)
|
|
3031 |
|
|
3032 |
fn:ends-with("",())
|
|
3033 |
'.
|
|
3034 |
|
|
3035 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3036 |
|
|
3037 |
|
|
3038 |
result := interpreter evaluate: query.
|
|
3039 |
self
|
|
3040 |
assert: (self xqtsResultTextFromResult: result)
|
|
3041 |
= (self xqtsResultTextFromFile:
|
|
3042 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-5.txt')
|
|
3043 |
|
|
3044 |
"Created: / 11-05-2013 / 19:24:42 / jirka"
|
|
3045 |
!
|
|
3046 |
|
|
3047 |
test_fn_ends_with_6
|
|
3048 |
|
|
3049 |
| query result |
|
|
3050 |
|
|
3051 |
query := '
|
|
3052 |
(:*******************************************************:)
|
|
3053 |
(:Test: fn-ends-with-6 :)
|
|
3054 |
(:Written By: Carmelo Montanez :)
|
|
3055 |
(:Date: Fri May 27, 2005 :)
|
|
3056 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
3057 |
(: with the arguments set as follows: :)
|
|
3058 |
(:$arg1 = "A Character String" :)
|
|
3059 |
(:$arg2 = () :)
|
|
3060 |
(:*******************************************************:)
|
|
3061 |
|
|
3062 |
fn:ends-with("A Character String",())
|
|
3063 |
'.
|
|
3064 |
|
|
3065 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3066 |
|
|
3067 |
|
|
3068 |
result := interpreter evaluate: query.
|
|
3069 |
self
|
|
3070 |
assert: (self xqtsResultTextFromResult: result)
|
|
3071 |
= (self xqtsResultTextFromFile:
|
|
3072 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-6.txt')
|
|
3073 |
|
|
3074 |
"Created: / 11-05-2013 / 19:24:53 / jirka"
|
|
3075 |
!
|
|
3076 |
|
|
3077 |
test_fn_ends_with_7
|
|
3078 |
|
|
3079 |
| query result |
|
|
3080 |
|
|
3081 |
query := '
|
|
3082 |
(:*******************************************************:)
|
|
3083 |
(:Test: fn-ends-with-7 :)
|
|
3084 |
(:Written By: Carmelo Montanez :)
|
|
3085 |
(:Date: Fri May 27, 2005 :)
|
|
3086 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
3087 |
(: with the arguments set as follows: :)
|
|
3088 |
(:$arg1 = () :)
|
|
3089 |
(:$arg2 = "A Character String" :)
|
|
3090 |
(:*******************************************************:)
|
|
3091 |
|
|
3092 |
fn:ends-with((),"A Character String")
|
|
3093 |
'.
|
|
3094 |
|
|
3095 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3096 |
|
|
3097 |
|
|
3098 |
result := interpreter evaluate: query.
|
|
3099 |
self
|
|
3100 |
assert: (self xqtsResultTextFromResult: result)
|
|
3101 |
= (self xqtsResultTextFromFile:
|
|
3102 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-7.txt')
|
|
3103 |
|
|
3104 |
"Created: / 11-05-2013 / 19:25:02 / jirka"
|
|
3105 |
!
|
|
3106 |
|
|
3107 |
test_fn_ends_with_8
|
|
3108 |
|
|
3109 |
| query result |
|
|
3110 |
|
|
3111 |
query := '
|
|
3112 |
(:*******************************************************:)
|
|
3113 |
(:Test: fn-ends-with-8 :)
|
|
3114 |
(:Written By: Carmelo Montanez :)
|
|
3115 |
(:Date: Fri May 27, 2005 :)
|
|
3116 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
3117 |
(: with the arguments set as follows: :)
|
|
3118 |
(:$arg1 = "AAAAABBBBBCCCCC" :)
|
|
3119 |
(:$arg2 = "BBBBB" :)
|
|
3120 |
(:*******************************************************:)
|
|
3121 |
|
|
3122 |
fn:ends-with("AAAAABBBBBCCCCC","BBBBB")
|
|
3123 |
'.
|
|
3124 |
|
|
3125 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3126 |
|
|
3127 |
|
|
3128 |
result := interpreter evaluate: query.
|
|
3129 |
self
|
|
3130 |
assert: (self xqtsResultTextFromResult: result)
|
|
3131 |
= (self xqtsResultTextFromFile:
|
|
3132 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-8.txt')
|
|
3133 |
|
|
3134 |
"Created: / 11-05-2013 / 19:25:12 / jirka"
|
|
3135 |
!
|
|
3136 |
|
|
3137 |
test_fn_ends_with_9
|
|
3138 |
|
|
3139 |
| query result |
|
|
3140 |
|
|
3141 |
query := '
|
|
3142 |
(:*******************************************************:)
|
|
3143 |
(:Test: fn-ends-with-9 :)
|
|
3144 |
(:Written By: Carmelo Montanez :)
|
|
3145 |
(:Date: Fri May 27, 2005 :)
|
|
3146 |
(:Purpose: Evaluates The "ends-with" function :)
|
|
3147 |
(: with the arguments set as follows: :)
|
|
3148 |
(:$arg1 = "AAAAABBBBB" :)
|
|
3149 |
(:$arg2 = " " :)
|
|
3150 |
(:*******************************************************:)
|
|
3151 |
|
|
3152 |
fn:ends-with("AAAAABBBBB"," ")
|
|
3153 |
'.
|
|
3154 |
|
|
3155 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3156 |
|
|
3157 |
|
|
3158 |
result := interpreter evaluate: query.
|
|
3159 |
self
|
|
3160 |
assert: (self xqtsResultTextFromResult: result)
|
|
3161 |
= (self xqtsResultTextFromFile:
|
|
3162 |
'Functions/AllStringFunc/SubstringStringFunc/EndsWithFunc/fn-ends-with-9.txt')
|
|
3163 |
|
|
3164 |
"Created: / 11-05-2013 / 19:25:21 / jirka"
|
|
3165 |
!
|
|
3166 |
|
|
3167 |
test_fn_lower_case_1
|
|
3168 |
|
|
3169 |
| query result |
|
|
3170 |
|
|
3171 |
query := '
|
|
3172 |
(: Name: fn-lower-case-1 :)
|
|
3173 |
(: Description: Evaluation of lower-case function as per example 1 (for this function) :)
|
|
3174 |
(: from the F&O specs. :)
|
|
3175 |
|
|
3176 |
fn:lower-case("ABc!!D")
|
|
3177 |
'.
|
|
3178 |
|
|
3179 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3180 |
|
|
3181 |
|
|
3182 |
result := interpreter evaluate: query.
|
|
3183 |
self
|
|
3184 |
assert: (self xqtsResultTextFromResult: result)
|
|
3185 |
= (self xqtsResultTextFromFile:
|
|
3186 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-1.txt')
|
|
3187 |
|
|
3188 |
"Created: / 11-05-2013 / 19:32:03 / jirka"
|
|
3189 |
!
|
|
3190 |
|
|
3191 |
test_fn_lower_case_10
|
|
3192 |
|
|
3193 |
| query result |
|
|
3194 |
|
|
3195 |
query := '
|
|
3196 |
(: Name: fn-lower-case-10 :)
|
|
3197 |
(: Description: Evaluation of lower-case function with argument set to "*****":)
|
|
3198 |
|
|
3199 |
fn:lower-case("*****")
|
|
3200 |
'.
|
|
3201 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3202 |
|
|
3203 |
|
|
3204 |
result := interpreter evaluate: query.
|
|
3205 |
self
|
|
3206 |
assert: (self xqtsResultTextFromResult: result)
|
|
3207 |
= (self xqtsResultTextFromFile:
|
|
3208 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-10.txt')
|
|
3209 |
|
|
3210 |
"Created: / 11-05-2013 / 19:32:27 / jirka"
|
|
3211 |
!
|
|
3212 |
|
|
3213 |
test_fn_lower_case_11
|
|
3214 |
|
|
3215 |
| query result |
|
|
3216 |
|
|
3217 |
query := '
|
|
3218 |
(: Name: fn-lower-case-11 :)
|
|
3219 |
(: Description: Evaluation of lower-case function with argument set to another lower-case function:)
|
|
3220 |
|
|
3221 |
fn:lower-case(lower-case("zzzzz"))
|
|
3222 |
'.
|
|
3223 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3224 |
|
|
3225 |
|
|
3226 |
result := interpreter evaluate: query.
|
|
3227 |
self
|
|
3228 |
assert: (self xqtsResultTextFromResult: result)
|
|
3229 |
= (self xqtsResultTextFromFile:
|
|
3230 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-11.txt')
|
|
3231 |
|
|
3232 |
"Created: / 11-05-2013 / 19:32:45 / jirka"
|
|
3233 |
!
|
|
3234 |
|
|
3235 |
test_fn_lower_case_12
|
|
3236 |
|
|
3237 |
| query result |
|
|
3238 |
|
|
3239 |
query := '
|
|
3240 |
(: Name: fn-lower-case-12 :)
|
|
3241 |
(: Description: Evaluation of lower-case function as an argument to the "fn:boolean" function:)
|
|
3242 |
|
|
3243 |
fn:boolean(fn:lower-case("abcde"))
|
|
3244 |
'.
|
|
3245 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3246 |
|
|
3247 |
|
|
3248 |
result := interpreter evaluate: query.
|
|
3249 |
self
|
|
3250 |
assert: (self xqtsResultTextFromResult: result)
|
|
3251 |
= (self xqtsResultTextFromFile:
|
|
3252 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-12.txt')
|
|
3253 |
|
|
3254 |
"Created: / 11-05-2013 / 19:32:58 / jirka"
|
|
3255 |
!
|
|
3256 |
|
|
3257 |
test_fn_lower_case_13
|
|
3258 |
|
|
3259 |
| query result |
|
|
3260 |
|
|
3261 |
query := '
|
|
3262 |
(: Name: fn-lower-case-13 :)
|
|
3263 |
(: Description: Evaluation of lower-case function as an argument to the "fn:concat" function:)
|
|
3264 |
|
|
3265 |
fn:concat(fn:lower-case("abcde"), fn:lower-case("fghi"))
|
|
3266 |
'.
|
|
3267 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3268 |
|
|
3269 |
|
|
3270 |
result := interpreter evaluate: query.
|
|
3271 |
self
|
|
3272 |
assert: (self xqtsResultTextFromResult: result)
|
|
3273 |
= (self xqtsResultTextFromFile:
|
|
3274 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-13.txt')
|
|
3275 |
|
|
3276 |
"Created: / 11-05-2013 / 19:33:12 / jirka"
|
|
3277 |
!
|
|
3278 |
|
|
3279 |
test_fn_lower_case_14
|
|
3280 |
|
|
3281 |
| query result |
|
|
3282 |
|
|
3283 |
query := '
|
|
3284 |
(: Name: fn-lower-case-14 :)
|
|
3285 |
(: Description: Evaluation of lower-case function as an argument to the "fn:not" function:)
|
|
3286 |
|
|
3287 |
fn:not(fn:lower-case("abcde"))
|
|
3288 |
'.
|
|
3289 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3290 |
|
|
3291 |
|
|
3292 |
result := interpreter evaluate: query.
|
|
3293 |
self
|
|
3294 |
assert: (self xqtsResultTextFromResult: result)
|
|
3295 |
= (self xqtsResultTextFromFile:
|
|
3296 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-14.txt')
|
|
3297 |
|
|
3298 |
"Created: / 11-05-2013 / 19:33:25 / jirka"
|
|
3299 |
!
|
|
3300 |
|
|
3301 |
test_fn_lower_case_15
|
|
3302 |
|
|
3303 |
| query result |
|
|
3304 |
|
|
3305 |
query := '
|
|
3306 |
(: Name: fn-lower-case-15 :)
|
|
3307 |
(: Description: Evaluation of lower-case function with argument set to "%$#@!!":)
|
|
3308 |
|
|
3309 |
fn:lower-case("%$#@!!")
|
|
3310 |
'.
|
|
3311 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3312 |
|
|
3313 |
|
|
3314 |
result := interpreter evaluate: query.
|
|
3315 |
self
|
|
3316 |
assert: (self xqtsResultTextFromResult: result)
|
|
3317 |
= (self xqtsResultTextFromFile:
|
|
3318 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-15.txt')
|
|
3319 |
|
|
3320 |
"Created: / 11-05-2013 / 19:33:35 / jirka"
|
|
3321 |
!
|
|
3322 |
|
|
3323 |
test_fn_lower_case_16
|
|
3324 |
|
|
3325 |
| query result |
|
|
3326 |
|
|
3327 |
query := '
|
|
3328 |
(: Name: fn-lower-case-16 :)
|
|
3329 |
(: Description: Evaluation of lower-case function with argument set to "lower-case":)
|
|
3330 |
|
|
3331 |
fn:lower-case("lower-case")
|
|
3332 |
'.
|
|
3333 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3334 |
|
|
3335 |
|
|
3336 |
result := interpreter evaluate: query.
|
|
3337 |
self
|
|
3338 |
assert: (self xqtsResultTextFromResult: result)
|
|
3339 |
= (self xqtsResultTextFromFile:
|
|
3340 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-16.txt')
|
|
3341 |
|
|
3342 |
"Created: / 11-05-2013 / 19:33:49 / jirka"
|
|
3343 |
!
|
|
3344 |
|
|
3345 |
test_fn_lower_case_17
|
|
3346 |
|
|
3347 |
| query result |
|
|
3348 |
|
|
3349 |
query := '
|
|
3350 |
(: Name: fn-lower-case-17 :)
|
|
3351 |
(: Description: Evaluation of lower-case function as part of a boolean expression:)
|
|
3352 |
|
|
3353 |
fn:lower-case("abc") and fn:lower-case("abc")
|
|
3354 |
'.
|
|
3355 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3356 |
|
|
3357 |
|
|
3358 |
result := interpreter evaluate: query.
|
|
3359 |
self
|
|
3360 |
assert: (self xqtsResultTextFromResult: result)
|
|
3361 |
= (self xqtsResultTextFromFile:
|
|
3362 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-17.txt')
|
|
3363 |
|
|
3364 |
"Created: / 11-05-2013 / 19:34:02 / jirka"
|
|
3365 |
!
|
|
3366 |
|
|
3367 |
test_fn_lower_case_2
|
|
3368 |
|
|
3369 |
| query result |
|
|
3370 |
|
|
3371 |
query := '
|
|
3372 |
(: Name: fn-lower-case-2 :)
|
|
3373 |
(: Description: Evaluation of lower-case function using the empty sequence :)
|
|
3374 |
(: Uses the count function to avoid empty file. :)
|
|
3375 |
|
|
3376 |
fn:count(fn:lower-case(()))
|
|
3377 |
'.
|
|
3378 |
|
|
3379 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3380 |
|
|
3381 |
|
|
3382 |
result := interpreter evaluate: query.
|
|
3383 |
self
|
|
3384 |
assert: (self xqtsResultTextFromResult: result)
|
|
3385 |
= (self xqtsResultTextFromFile:
|
|
3386 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-2.txt')
|
|
3387 |
|
|
3388 |
"Created: / 11-05-2013 / 19:34:15 / jirka"
|
|
3389 |
!
|
|
3390 |
|
|
3391 |
test_fn_lower_case_3
|
|
3392 |
|
|
3393 |
| query result |
|
|
3394 |
|
|
3395 |
query := '
|
|
3396 |
(: Name: fn-lower-case-3 :)
|
|
3397 |
(: Description: Evaluation of lower-case function that uses only numbers as part of argument:)
|
|
3398 |
(: Use of count function to avoid empty file. :)
|
|
3399 |
|
|
3400 |
fn:lower-case("12345")
|
|
3401 |
'.
|
|
3402 |
|
|
3403 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3404 |
|
|
3405 |
|
|
3406 |
result := interpreter evaluate: query.
|
|
3407 |
self
|
|
3408 |
assert: (self xqtsResultTextFromResult: result)
|
|
3409 |
= (self xqtsResultTextFromFile:
|
|
3410 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-3.txt')
|
|
3411 |
|
|
3412 |
"Created: / 11-05-2013 / 19:34:27 / jirka"
|
|
3413 |
!
|
|
3414 |
|
|
3415 |
test_fn_lower_case_4
|
|
3416 |
|
|
3417 |
| query result |
|
|
3418 |
|
|
3419 |
query := '
|
|
3420 |
(: Name: fn-lower-case-4 :)
|
|
3421 |
(: Description: Evaluation of lower-case function that uses both numbers and letters as part of argument:)
|
|
3422 |
|
|
3423 |
fn:lower-case("12345abcd")
|
|
3424 |
'.
|
|
3425 |
|
|
3426 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3427 |
|
|
3428 |
|
|
3429 |
result := interpreter evaluate: query.
|
|
3430 |
self
|
|
3431 |
assert: (self xqtsResultTextFromResult: result)
|
|
3432 |
= (self xqtsResultTextFromFile:
|
|
3433 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-4.txt')
|
|
3434 |
|
|
3435 |
"Created: / 11-05-2013 / 19:34:41 / jirka"
|
|
3436 |
!
|
|
3437 |
|
|
3438 |
test_fn_lower_case_5
|
|
3439 |
|
|
3440 |
| query result |
|
|
3441 |
|
|
3442 |
query := '
|
|
3443 |
(: Name: fn-lower-case-5 :)
|
|
3444 |
(: Description: Evaluation of lower-case function that uses only upper case letters as part of argument:)
|
|
3445 |
|
|
3446 |
fn:lower-case("ABCD")
|
|
3447 |
'.
|
|
3448 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3449 |
|
|
3450 |
|
|
3451 |
result := interpreter evaluate: query.
|
|
3452 |
self
|
|
3453 |
assert: (self xqtsResultTextFromResult: result)
|
|
3454 |
= (self xqtsResultTextFromFile:
|
|
3455 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-5.txt')
|
|
3456 |
|
|
3457 |
"Created: / 11-05-2013 / 19:34:52 / jirka"
|
|
3458 |
!
|
|
3459 |
|
|
3460 |
test_fn_lower_case_6
|
|
3461 |
|
|
3462 |
| query result |
|
|
3463 |
|
|
3464 |
query := '
|
|
3465 |
(: Name: fn-lower-case-6 :)
|
|
3466 |
(: Description: Evaluation of lower-case function that uses only lower case letters as part of argument:)
|
|
3467 |
|
|
3468 |
fn:lower-case("abcde")
|
|
3469 |
'.
|
|
3470 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3471 |
|
|
3472 |
|
|
3473 |
result := interpreter evaluate: query.
|
|
3474 |
self
|
|
3475 |
assert: (self xqtsResultTextFromResult: result)
|
|
3476 |
= (self xqtsResultTextFromFile:
|
|
3477 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-6.txt')
|
|
3478 |
|
|
3479 |
"Created: / 11-05-2013 / 19:35:04 / jirka"
|
|
3480 |
!
|
|
3481 |
|
|
3482 |
test_fn_lower_case_7
|
|
3483 |
|
|
3484 |
| query result |
|
|
3485 |
|
|
3486 |
query := '
|
|
3487 |
(: Name: fn-lower-case-7 :)
|
|
3488 |
(: Description: Evaluation of lower-case function that uses both upper and lower case letters as part of argument:)
|
|
3489 |
|
|
3490 |
fn:lower-case("ABCDEabcde")
|
|
3491 |
'.
|
|
3492 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3493 |
|
|
3494 |
|
|
3495 |
result := interpreter evaluate: query.
|
|
3496 |
self
|
|
3497 |
assert: (self xqtsResultTextFromResult: result)
|
|
3498 |
= (self xqtsResultTextFromFile:
|
|
3499 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-7.txt')
|
|
3500 |
|
|
3501 |
"Created: / 11-05-2013 / 19:35:15 / jirka"
|
|
3502 |
!
|
|
3503 |
|
|
3504 |
test_fn_lower_case_8
|
|
3505 |
|
|
3506 |
| query result |
|
|
3507 |
|
|
3508 |
query := '
|
|
3509 |
(: Name: fn-lower-case-8 :)
|
|
3510 |
(: Description: Evaluation of lower-case function that uses the empty string as part of argument:)
|
|
3511 |
(: Uses "fn:count" to avoid the empty file :)
|
|
3512 |
|
|
3513 |
fn:count(fn:lower-case(""))
|
|
3514 |
'.
|
|
3515 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3516 |
|
|
3517 |
|
|
3518 |
result := interpreter evaluate: query.
|
|
3519 |
self
|
|
3520 |
assert: (self xqtsResultTextFromResult: result)
|
|
3521 |
= (self xqtsResultTextFromFile:
|
|
3522 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-8.txt')
|
|
3523 |
|
|
3524 |
"Created: / 11-05-2013 / 19:35:26 / jirka"
|
|
3525 |
!
|
|
3526 |
|
|
3527 |
test_fn_lower_case_9
|
|
3528 |
|
|
3529 |
| query result |
|
|
3530 |
|
|
3531 |
query := '
|
|
3532 |
(: Name: fn-lower-case-9 :)
|
|
3533 |
(: Description: Evaluation of lower-case function that uses the "upper-case" as part of argument:)
|
|
3534 |
|
|
3535 |
fn:lower-case(upper-case("AbcDH"))
|
|
3536 |
'.
|
|
3537 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3538 |
|
|
3539 |
|
|
3540 |
result := interpreter evaluate: query.
|
|
3541 |
self
|
|
3542 |
assert: (self xqtsResultTextFromResult: result)
|
|
3543 |
= (self xqtsResultTextFromFile:
|
|
3544 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case-9.txt')
|
|
3545 |
|
|
3546 |
"Created: / 11-05-2013 / 19:35:41 / jirka"
|
|
3547 |
!
|
|
3548 |
|
|
3549 |
test_fn_lower_case_largs_1
|
|
3550 |
|
|
3551 |
| query result |
|
|
3552 |
|
|
3553 |
query := '
|
|
3554 |
(:*******************************************************:)
|
|
3555 |
(:Test: lower-case1args-1 :)
|
|
3556 |
(:Written By: Carmelo Montanez :)
|
|
3557 |
(:Date: Fri Dec 10 10:15:47 GMT-05:00 2004 :)
|
|
3558 |
(:Purpose: Evaluates The "lower-case" function :)
|
|
3559 |
(: with the arguments set as follows: :)
|
|
3560 |
(:$arg = xs:string(lower bound) :)
|
|
3561 |
(:*******************************************************:)
|
|
3562 |
|
|
3563 |
fn:lower-case(xs:string("This is a characte"))
|
|
3564 |
'.
|
|
3565 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3566 |
|
|
3567 |
|
|
3568 |
result := interpreter evaluate: query.
|
|
3569 |
self
|
|
3570 |
assert: (self xqtsResultTextFromResult: result)
|
|
3571 |
= (self xqtsResultTextFromFile:
|
|
3572 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case1args-1.txt')
|
|
3573 |
|
|
3574 |
"Created: / 11-05-2013 / 19:35:54 / jirka"
|
|
3575 |
!
|
|
3576 |
|
|
3577 |
test_fn_lower_case_largs_2
|
|
3578 |
|
|
3579 |
| query result |
|
|
3580 |
|
|
3581 |
query := '
|
|
3582 |
(:*******************************************************:)
|
|
3583 |
(:Test: lower-case1args-2 :)
|
|
3584 |
(:Written By: Carmelo Montanez :)
|
|
3585 |
(:Date: Fri Dec 10 10:15:47 GMT-05:00 2004 :)
|
|
3586 |
(:Purpose: Evaluates The "lower-case" function :)
|
|
3587 |
(: with the arguments set as follows: :)
|
|
3588 |
(:$arg = xs:string(mid range) :)
|
|
3589 |
(:*******************************************************:)
|
|
3590 |
|
|
3591 |
fn:lower-case(xs:string("This is a characte"))
|
|
3592 |
'.
|
|
3593 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3594 |
|
|
3595 |
|
|
3596 |
result := interpreter evaluate: query.
|
|
3597 |
self
|
|
3598 |
assert: (self xqtsResultTextFromResult: result)
|
|
3599 |
= (self xqtsResultTextFromFile:
|
|
3600 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case1args-2.txt')
|
|
3601 |
|
|
3602 |
"Created: / 11-05-2013 / 19:36:18 / jirka"
|
|
3603 |
!
|
|
3604 |
|
|
3605 |
test_fn_lower_case_largs_3
|
|
3606 |
|
|
3607 |
| query result |
|
|
3608 |
|
|
3609 |
query := '
|
|
3610 |
(:*******************************************************:)
|
|
3611 |
(:Test: lower-case1args-3 :)
|
|
3612 |
(:Written By: Carmelo Montanez :)
|
|
3613 |
(:Date: Fri Dec 10 10:15:47 GMT-05:00 2004 :)
|
|
3614 |
(:Purpose: Evaluates The "lower-case" function :)
|
|
3615 |
(: with the arguments set as follows: :)
|
|
3616 |
(:$arg = xs:string(upper bound) :)
|
|
3617 |
(:*******************************************************:)
|
|
3618 |
|
|
3619 |
fn:lower-case(xs:string("This is a characte"))
|
|
3620 |
'.
|
|
3621 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3622 |
|
|
3623 |
|
|
3624 |
result := interpreter evaluate: query.
|
|
3625 |
self
|
|
3626 |
assert: (self xqtsResultTextFromResult: result)
|
|
3627 |
= (self xqtsResultTextFromFile:
|
|
3628 |
'Functions/AllStringFunc/GeneralStringFunc/LowerCaseFunc/fn-lower-case1args-3.txt')
|
|
3629 |
|
|
3630 |
"Created: / 11-05-2013 / 19:36:50 / jirka"
|
|
3631 |
!
|
|
3632 |
|
|
3633 |
test_fn_matches_1
|
|
3634 |
|
|
3635 |
| query result |
|
|
3636 |
|
|
3637 |
query := '
|
|
3638 |
(: Name: fn-matches-1 :)
|
|
3639 |
(: Description: Evaluation of matches function as per example 1 (for this function) :)
|
|
3640 |
|
|
3641 |
|
|
3642 |
fn:matches("abracadabra", "bra")
|
|
3643 |
'.
|
|
3644 |
|
|
3645 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3646 |
|
|
3647 |
|
|
3648 |
result := interpreter evaluate: query.
|
|
3649 |
self
|
|
3650 |
assert: (self xqtsResultTextFromResult: result)
|
|
3651 |
= (self xqtsResultTextFromFile:
|
|
3652 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-1.txt')
|
|
3653 |
|
|
3654 |
"Created: / 11-05-2013 / 19:25:37 / jirka"
|
|
3655 |
!
|
|
3656 |
|
|
3657 |
test_fn_matches_10
|
|
3658 |
|
|
3659 |
| query result |
|
|
3660 |
|
|
3661 |
query := '
|
|
3662 |
(: Name: fn-matches-10 :)
|
|
3663 |
(: Description: Evaluation of matches function with pattern set to "\{" for an input string that contains "}". :)
|
|
3664 |
|
|
3665 |
fn:matches("abracadabra{abracadabra", "\{")
|
|
3666 |
'.
|
|
3667 |
|
|
3668 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3669 |
|
|
3670 |
|
|
3671 |
result := interpreter evaluate: query.
|
|
3672 |
self
|
|
3673 |
assert: (self xqtsResultTextFromResult: result)
|
|
3674 |
= (self xqtsResultTextFromFile:
|
|
3675 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-10.txt')
|
|
3676 |
|
|
3677 |
"Created: / 11-05-2013 / 19:25:50 / jirka"
|
|
3678 |
!
|
|
3679 |
|
|
3680 |
test_fn_matches_11
|
|
3681 |
|
|
3682 |
| query result |
|
|
3683 |
|
|
3684 |
query := '
|
|
3685 |
(: Name: fn-matches-11 :)
|
|
3686 |
(: Description: Evaluation of matches function with pattern set to "\}" for an input string that contains "}". :)
|
|
3687 |
|
|
3688 |
fn:matches("abracadabra}abracadabra", "\}")
|
|
3689 |
'.
|
|
3690 |
|
|
3691 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3692 |
|
|
3693 |
|
|
3694 |
result := interpreter evaluate: query.
|
|
3695 |
self
|
|
3696 |
assert: (self xqtsResultTextFromResult: result)
|
|
3697 |
= (self xqtsResultTextFromFile:
|
|
3698 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-11.txt')
|
|
3699 |
|
|
3700 |
"Created: / 11-05-2013 / 19:26:02 / jirka"
|
|
3701 |
!
|
|
3702 |
|
|
3703 |
test_fn_matches_12
|
|
3704 |
|
|
3705 |
| query result |
|
|
3706 |
|
|
3707 |
query := '
|
|
3708 |
(: Name: fn-matches-12 :)
|
|
3709 |
(: Description: Evaluation of matches function with pattern set to "\(" for an input string that contains "(". :)
|
|
3710 |
|
|
3711 |
fn:matches("abracadabra(abracadabra", "\(")
|
|
3712 |
'.
|
|
3713 |
|
|
3714 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3715 |
|
|
3716 |
|
|
3717 |
result := interpreter evaluate: query.
|
|
3718 |
self
|
|
3719 |
assert: (self xqtsResultTextFromResult: result)
|
|
3720 |
= (self xqtsResultTextFromFile:
|
|
3721 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-12.txt')
|
|
3722 |
|
|
3723 |
"Created: / 11-05-2013 / 19:26:11 / jirka"
|
|
3724 |
!
|
|
3725 |
|
|
3726 |
test_fn_matches_13
|
|
3727 |
|
|
3728 |
| query result |
|
|
3729 |
|
|
3730 |
query := '
|
|
3731 |
(: Name: fn-matches-13 :)
|
|
3732 |
(: Description: Evaluation of matches function with pattern set to "\)" for an input string that contains ")". :)
|
|
3733 |
|
|
3734 |
fn:matches("abracadabra)abracadabra", "\)")
|
|
3735 |
'.
|
|
3736 |
|
|
3737 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3738 |
|
|
3739 |
|
|
3740 |
result := interpreter evaluate: query.
|
|
3741 |
self
|
|
3742 |
assert: (self xqtsResultTextFromResult: result)
|
|
3743 |
= (self xqtsResultTextFromFile:
|
|
3744 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-13.txt')
|
|
3745 |
|
|
3746 |
"Created: / 11-05-2013 / 19:26:22 / jirka"
|
|
3747 |
!
|
|
3748 |
|
|
3749 |
test_fn_matches_14
|
|
3750 |
|
|
3751 |
| query result |
|
|
3752 |
|
|
3753 |
query := '
|
|
3754 |
(: Name: fn-matches-14 :)
|
|
3755 |
(: Description: Evaluation of matches function with pattern set to "\[" for an input string that contains "[". :)
|
|
3756 |
|
|
3757 |
fn:matches("abracadabra[abracadabra", "\[")
|
|
3758 |
'.
|
|
3759 |
|
|
3760 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3761 |
|
|
3762 |
|
|
3763 |
result := interpreter evaluate: query.
|
|
3764 |
self
|
|
3765 |
assert: (self xqtsResultTextFromResult: result)
|
|
3766 |
= (self xqtsResultTextFromFile:
|
|
3767 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-14.txt')
|
|
3768 |
|
|
3769 |
"Created: / 11-05-2013 / 19:26:33 / jirka"
|
|
3770 |
!
|
|
3771 |
|
|
3772 |
test_fn_matches_15
|
|
3773 |
|
|
3774 |
| query result |
|
|
3775 |
|
|
3776 |
query := '
|
|
3777 |
(: Name: fn-matches-15 :)
|
|
3778 |
(: Description: Evaluation of matches function with pattern set to "\]" for an input string that contains "]". :)
|
|
3779 |
|
|
3780 |
fn:matches("abracadabra]abracadabra", "\]")
|
|
3781 |
'.
|
|
3782 |
|
|
3783 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3784 |
|
|
3785 |
|
|
3786 |
result := interpreter evaluate: query.
|
|
3787 |
self
|
|
3788 |
assert: (self xqtsResultTextFromResult: result)
|
|
3789 |
= (self xqtsResultTextFromFile:
|
|
3790 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-15.txt')
|
|
3791 |
|
|
3792 |
"Created: / 11-05-2013 / 19:26:42 / jirka"
|
|
3793 |
!
|
|
3794 |
|
|
3795 |
test_fn_matches_16
|
|
3796 |
|
|
3797 |
| query result |
|
|
3798 |
|
|
3799 |
query := '
|
|
3800 |
(: Name: fn-matches-16 :)
|
|
3801 |
(: Description: Evaluation of matches function with pattern set to "\-" for an input string that contains "-". :)
|
|
3802 |
|
|
3803 |
fn:matches("abracadabra-abracadabra", "\-")
|
|
3804 |
'.
|
|
3805 |
|
|
3806 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3807 |
|
|
3808 |
|
|
3809 |
result := interpreter evaluate: query.
|
|
3810 |
self
|
|
3811 |
assert: (self xqtsResultTextFromResult: result)
|
|
3812 |
= (self xqtsResultTextFromFile:
|
|
3813 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-16.txt')
|
|
3814 |
|
|
3815 |
"Created: / 11-05-2013 / 19:26:51 / jirka"
|
|
3816 |
!
|
|
3817 |
|
|
3818 |
test_fn_matches_17
|
|
3819 |
|
|
3820 |
| query result |
|
|
3821 |
|
|
3822 |
query := '
|
|
3823 |
(: Name: fn-matches-17 :)
|
|
3824 |
(: Description: Evaluation of matches function with pattern set to "\." for an input string that contains ".". :)
|
|
3825 |
|
|
3826 |
fn:matches("abracadabra.abracadabra", "\.")
|
|
3827 |
'.
|
|
3828 |
|
|
3829 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3830 |
|
|
3831 |
|
|
3832 |
result := interpreter evaluate: query.
|
|
3833 |
self
|
|
3834 |
assert: (self xqtsResultTextFromResult: result)
|
|
3835 |
= (self xqtsResultTextFromFile:
|
|
3836 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-17.txt')
|
|
3837 |
|
|
3838 |
"Created: / 11-05-2013 / 19:27:00 / jirka"
|
|
3839 |
!
|
|
3840 |
|
|
3841 |
test_fn_matches_18
|
|
3842 |
|
|
3843 |
| query result |
|
|
3844 |
|
|
3845 |
query := '
|
|
3846 |
(: Name: fn-matches-18 :)
|
|
3847 |
(: Description: Evaluation of matches function with pattern set to "\|" for an input string that contains "|". :)
|
|
3848 |
|
|
3849 |
fn:matches("abracadabra|abracadabra", "\|")
|
|
3850 |
'.
|
|
3851 |
|
|
3852 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3853 |
|
|
3854 |
|
|
3855 |
result := interpreter evaluate: query.
|
|
3856 |
self
|
|
3857 |
assert: (self xqtsResultTextFromResult: result)
|
|
3858 |
= (self xqtsResultTextFromFile:
|
|
3859 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-18.txt')
|
|
3860 |
|
|
3861 |
"Created: / 11-05-2013 / 19:27:09 / jirka"
|
|
3862 |
!
|
|
3863 |
|
|
3864 |
test_fn_matches_19
|
|
3865 |
|
|
3866 |
| query result |
|
|
3867 |
|
|
3868 |
query := '
|
|
3869 |
(: Name: fn-matches-19 :)
|
|
3870 |
(: Description: Evaluation of matches function with pattern set to "\\" for an input string that contains "\". :)
|
|
3871 |
|
|
3872 |
fn:matches("abracadabra\abracadabra", "\\")
|
|
3873 |
'.
|
|
3874 |
|
|
3875 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3876 |
|
|
3877 |
|
|
3878 |
result := interpreter evaluate: query.
|
|
3879 |
self
|
|
3880 |
assert: (self xqtsResultTextFromResult: result)
|
|
3881 |
= (self xqtsResultTextFromFile:
|
|
3882 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-19.txt')
|
|
3883 |
|
|
3884 |
"Created: / 11-05-2013 / 19:27:18 / jirka"
|
|
3885 |
!
|
|
3886 |
|
|
3887 |
test_fn_matches_2
|
|
3888 |
|
|
3889 |
| query result |
|
|
3890 |
|
|
3891 |
query := '
|
|
3892 |
(: Name: fn-matches-2 :)
|
|
3893 |
(: Description: Evaluation of matches function as per example 2 (for this function). Pattern set to "^a.*a$". :)
|
|
3894 |
|
|
3895 |
|
|
3896 |
fn:matches("abracadabra", "^a.*a$")
|
|
3897 |
'.
|
|
3898 |
|
|
3899 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3900 |
|
|
3901 |
|
|
3902 |
result := interpreter evaluate: query.
|
|
3903 |
self
|
|
3904 |
assert: (self xqtsResultTextFromResult: result)
|
|
3905 |
= (self xqtsResultTextFromFile:
|
|
3906 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-2.txt')
|
|
3907 |
|
|
3908 |
"Created: / 11-05-2013 / 19:27:29 / jirka"
|
|
3909 |
!
|
|
3910 |
|
|
3911 |
test_fn_matches_20
|
|
3912 |
|
|
3913 |
| query result |
|
|
3914 |
|
|
3915 |
query := '
|
|
3916 |
(: Name: fn-matches-20 :)
|
|
3917 |
(: Description: Evaluation of matches function with pattern set to "\t" for an input string that contains the tab character. :)
|
|
3918 |
|
|
3919 |
fn:matches("abracadabra abracadabra", "\t")
|
|
3920 |
'.
|
|
3921 |
|
|
3922 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3923 |
|
|
3924 |
|
|
3925 |
result := interpreter evaluate: query.
|
|
3926 |
self
|
|
3927 |
assert: (self xqtsResultTextFromResult: result)
|
|
3928 |
= (self xqtsResultTextFromFile:
|
|
3929 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-20.txt')
|
|
3930 |
|
|
3931 |
"Created: / 11-05-2013 / 19:27:46 / jirka"
|
|
3932 |
!
|
|
3933 |
|
|
3934 |
test_fn_matches_21
|
|
3935 |
|
|
3936 |
| query result |
|
|
3937 |
|
|
3938 |
query := '
|
|
3939 |
(: Name: fn-matches-21 :)
|
|
3940 |
(: Description: Evaluation of matches function with pattern set to "\n" for an input string that contains the newline character. :)
|
|
3941 |
|
|
3942 |
fn:matches("abracadabra
|
|
3943 |
abracadabra", "\n")
|
|
3944 |
'.
|
|
3945 |
|
|
3946 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3947 |
|
|
3948 |
|
|
3949 |
result := interpreter evaluate: query.
|
|
3950 |
self
|
|
3951 |
assert: (self xqtsResultTextFromResult: result)
|
|
3952 |
= (self xqtsResultTextFromFile:
|
|
3953 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-21.txt')
|
|
3954 |
|
|
3955 |
"Created: / 11-05-2013 / 19:28:08 / jirka"
|
|
3956 |
!
|
|
3957 |
|
|
3958 |
test_fn_matches_22
|
|
3959 |
|
|
3960 |
| query result |
|
|
3961 |
|
|
3962 |
query := '
|
|
3963 |
(: Name: fn-matches-22 :)
|
|
3964 |
(: Description: Evaluation of matches function with pattern set to "aa{1}" (exact quantity) for an input string that contains the "aa" string. :)
|
|
3965 |
|
|
3966 |
fn:matches("abracadabraabracadabra", "aa{1}")
|
|
3967 |
'.
|
|
3968 |
|
|
3969 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3970 |
|
|
3971 |
|
|
3972 |
result := interpreter evaluate: query.
|
|
3973 |
self
|
|
3974 |
assert: (self xqtsResultTextFromResult: result)
|
|
3975 |
= (self xqtsResultTextFromFile:
|
|
3976 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-22.txt')
|
|
3977 |
|
|
3978 |
"Created: / 11-05-2013 / 19:28:20 / jirka"
|
|
3979 |
!
|
|
3980 |
|
|
3981 |
test_fn_matches_23
|
|
3982 |
|
|
3983 |
| query result |
|
|
3984 |
|
|
3985 |
query := '
|
|
3986 |
(: Name: fn-matches-23 :)
|
|
3987 |
(: Description: Evaluation of matches function with pattern set to "aa{1,}" (min quantity) for an input string that contains the "aa" string twice. :)
|
|
3988 |
|
|
3989 |
fn:matches("abracadabraabracadabraabracadabra", "aa{1,}")
|
|
3990 |
'.
|
|
3991 |
|
|
3992 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
3993 |
|
|
3994 |
|
|
3995 |
result := interpreter evaluate: query.
|
|
3996 |
self
|
|
3997 |
assert: (self xqtsResultTextFromResult: result)
|
|
3998 |
= (self xqtsResultTextFromFile:
|
|
3999 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-23.txt')
|
|
4000 |
|
|
4001 |
"Created: / 11-05-2013 / 19:28:31 / jirka"
|
|
4002 |
!
|
|
4003 |
|
|
4004 |
test_fn_matches_24
|
|
4005 |
|
|
4006 |
| query result |
|
|
4007 |
|
|
4008 |
query := '
|
|
4009 |
(: Name: fn-matches-24 :)
|
|
4010 |
(: Description: Evaluation of matches function with pattern set to "aa{1,2}" (range quantity) for an input string that contains the "aa" string twice. :)
|
|
4011 |
|
|
4012 |
fn:matches("abracadabraabracadabraabracadabra", "aa{1,2}")
|
|
4013 |
'.
|
|
4014 |
|
|
4015 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4016 |
|
|
4017 |
|
|
4018 |
result := interpreter evaluate: query.
|
|
4019 |
self
|
|
4020 |
assert: (self xqtsResultTextFromResult: result)
|
|
4021 |
= (self xqtsResultTextFromFile:
|
|
4022 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-24.txt')
|
|
4023 |
|
|
4024 |
"Created: / 11-05-2013 / 19:28:40 / jirka"
|
|
4025 |
!
|
|
4026 |
|
|
4027 |
test_fn_matches_25
|
|
4028 |
|
|
4029 |
| query result |
|
|
4030 |
|
|
4031 |
query := '
|
|
4032 |
(: Name: fn-matches-25 :)
|
|
4033 |
(: Description: Evaluation of matches function with invalid regular expression :)
|
|
4034 |
|
|
4035 |
|
|
4036 |
fn:matches("abracadabra", "**%%")
|
|
4037 |
'.
|
|
4038 |
|
|
4039 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4040 |
|
|
4041 |
|
|
4042 |
result := interpreter evaluate: query.
|
|
4043 |
self
|
|
4044 |
assert: (self xqtsResultTextFromResult: result)
|
|
4045 |
= (self xqtsResultTextFromFile:
|
|
4046 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-25.txt')
|
|
4047 |
|
|
4048 |
"Created: / 11-05-2013 / 19:28:47 / jirka"
|
|
4049 |
!
|
|
4050 |
|
|
4051 |
test_fn_matches_26
|
|
4052 |
|
|
4053 |
| query result |
|
|
4054 |
|
|
4055 |
query := '
|
|
4056 |
(: Name: fn-matches-26 :)
|
|
4057 |
(: Description: Check for the correct behavior of ^ and $ in multi-line mode :)
|
|
4058 |
(: This test case was motivated by the resolution of Bug Report 4543 :)
|
|
4059 |
|
|
4060 |
|
|
4061 |
fn:matches("abcd
defg
", "^$", "m")
|
|
4062 |
'.
|
|
4063 |
|
|
4064 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4065 |
|
|
4066 |
|
|
4067 |
result := interpreter evaluate: query.
|
|
4068 |
self
|
|
4069 |
assert: (self xqtsResultTextFromResult: result)
|
|
4070 |
= (self xqtsResultTextFromFile:
|
|
4071 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-26.txt')
|
|
4072 |
|
|
4073 |
"Created: / 11-05-2013 / 19:28:57 / jirka"
|
|
4074 |
!
|
|
4075 |
|
|
4076 |
test_fn_matches_27
|
|
4077 |
|
|
4078 |
| query result |
|
|
4079 |
|
|
4080 |
query := '
|
|
4081 |
(: Name: fn-matches-27 :)
|
|
4082 |
(: Description: Check for the correct behavior of ^ and $ in multi-line mode :)
|
|
4083 |
(: This test case was motivated by the resolution of Bug Report 4543 :)
|
|
4084 |
|
|
4085 |
|
|
4086 |
fn:matches("
abcd
defg
", "^$", "m")
|
|
4087 |
'.
|
|
4088 |
|
|
4089 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4090 |
|
|
4091 |
|
|
4092 |
result := interpreter evaluate: query.
|
|
4093 |
self
|
|
4094 |
assert: (self xqtsResultTextFromResult: result)
|
|
4095 |
= (self xqtsResultTextFromFile:
|
|
4096 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-27.txt')
|
|
4097 |
|
|
4098 |
"Created: / 11-05-2013 / 19:29:08 / jirka"
|
|
4099 |
!
|
|
4100 |
|
|
4101 |
test_fn_matches_28
|
|
4102 |
|
|
4103 |
| query result |
|
|
4104 |
|
|
4105 |
query := '
|
|
4106 |
(: Name: fn-matches-28 :)
|
|
4107 |
(: Description: Check for the correct behavior of ^ and $ in multi-line mode :)
|
|
4108 |
(: This test case was motivated by the resolution of Bug Report 4543 :)
|
|
4109 |
|
|
4110 |
|
|
4111 |
fn:matches("abcd

defg
", "^$", "m")
|
|
4112 |
'.
|
|
4113 |
|
|
4114 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4115 |
|
|
4116 |
|
|
4117 |
result := interpreter evaluate: query.
|
|
4118 |
self
|
|
4119 |
assert: (self xqtsResultTextFromResult: result)
|
|
4120 |
= (self xqtsResultTextFromFile:
|
|
4121 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-28.txt')
|
|
4122 |
|
|
4123 |
"Created: / 11-05-2013 / 19:29:16 / jirka"
|
|
4124 |
!
|
|
4125 |
|
|
4126 |
test_fn_matches_29
|
|
4127 |
|
|
4128 |
| query result |
|
|
4129 |
|
|
4130 |
query := '
|
|
4131 |
(: Name: fn-matches-29 :)
|
|
4132 |
(: Description: 2-digits not treated as a back-reference :)
|
|
4133 |
(: See erratum FO.E24 :)
|
|
4134 |
|
|
4135 |
|
|
4136 |
fn:matches("#abc#1", "^(#)abc\11$")
|
|
4137 |
'.
|
|
4138 |
|
|
4139 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4140 |
|
|
4141 |
|
|
4142 |
result := interpreter evaluate: query.
|
|
4143 |
self
|
|
4144 |
assert: (self xqtsResultTextFromResult: result)
|
|
4145 |
= (self xqtsResultTextFromFile:
|
|
4146 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-29.txt')
|
|
4147 |
|
|
4148 |
"Created: / 11-05-2013 / 19:29:24 / jirka"
|
|
4149 |
!
|
|
4150 |
|
|
4151 |
test_fn_matches_3
|
|
4152 |
|
|
4153 |
| query result |
|
|
4154 |
|
|
4155 |
query := '
|
|
4156 |
(: Name: fn-matches-3 :)
|
|
4157 |
(: Description: Evaluation of matches function as per example 3 (for this function). Pattern set to "^bra" :)
|
|
4158 |
|
|
4159 |
fn:matches("abracadabra", "^bra")
|
|
4160 |
'.
|
|
4161 |
|
|
4162 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4163 |
|
|
4164 |
|
|
4165 |
result := interpreter evaluate: query.
|
|
4166 |
self
|
|
4167 |
assert: (self xqtsResultTextFromResult: result)
|
|
4168 |
= (self xqtsResultTextFromFile:
|
|
4169 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-3.txt')
|
|
4170 |
|
|
4171 |
"Created: / 11-05-2013 / 19:29:34 / jirka"
|
|
4172 |
!
|
|
4173 |
|
|
4174 |
test_fn_matches_30
|
|
4175 |
|
|
4176 |
| query result |
|
|
4177 |
|
|
4178 |
query := '
|
|
4179 |
(: Name: fn-matches-30 :)
|
|
4180 |
(: Description: 2-digits treated as a back-reference :)
|
|
4181 |
(: See erratum FO.E24 :)
|
|
4182 |
|
|
4183 |
|
|
4184 |
fn:matches("#abcdefghijklmnopq#1", "^(#)(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)\11$")
|
|
4185 |
'.
|
|
4186 |
|
|
4187 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4188 |
|
|
4189 |
|
|
4190 |
result := interpreter evaluate: query.
|
|
4191 |
self
|
|
4192 |
assert: (self xqtsResultTextFromResult: result)
|
|
4193 |
= (self xqtsResultTextFromFile:
|
|
4194 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-30.txt')
|
|
4195 |
|
|
4196 |
"Created: / 11-05-2013 / 19:29:42 / jirka"
|
|
4197 |
!
|
|
4198 |
|
|
4199 |
test_fn_matches_31
|
|
4200 |
|
|
4201 |
| query result |
|
|
4202 |
|
|
4203 |
query := '
|
|
4204 |
xquery version "1.1";
|
|
4205 |
|
|
4206 |
(: Name: fn-matches-31 :)
|
|
4207 |
(: Description: Evaluation of matches function with non-capturing groups (allowed in XQuery 1.1 :)
|
|
4208 |
|
|
4209 |
|
|
4210 |
fn:matches("abracadabra", "(?:abra(?:cad)?)*")
|
|
4211 |
'.
|
|
4212 |
|
|
4213 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4214 |
|
|
4215 |
|
|
4216 |
result := interpreter evaluate: query.
|
|
4217 |
self
|
|
4218 |
assert: (self xqtsResultTextFromResult: result)
|
|
4219 |
= (self xqtsResultTextFromFile:
|
|
4220 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-31.txt')
|
|
4221 |
|
|
4222 |
"Created: / 11-05-2013 / 19:29:55 / jirka"
|
|
4223 |
!
|
|
4224 |
|
|
4225 |
test_fn_matches_32
|
|
4226 |
|
|
4227 |
| query result |
|
|
4228 |
|
|
4229 |
query := '
|
|
4230 |
xquery version "1.1";
|
|
4231 |
|
|
4232 |
(: Name: fn-matches-32 :)
|
|
4233 |
(: Description: Evaluation of matches function with "q" flag (allowed in XQuery 1.1 :)
|
|
4234 |
|
|
4235 |
|
|
4236 |
fn:matches("abracadabra", "(?:abra(?:cad)?)*", "q")
|
|
4237 |
'.
|
|
4238 |
|
|
4239 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4240 |
|
|
4241 |
|
|
4242 |
result := interpreter evaluate: query.
|
|
4243 |
self
|
|
4244 |
assert: (self xqtsResultTextFromResult: result)
|
|
4245 |
= (self xqtsResultTextFromFile:
|
|
4246 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-32.txt')
|
|
4247 |
|
|
4248 |
"Created: / 11-05-2013 / 19:30:06 / jirka"
|
|
4249 |
!
|
|
4250 |
|
|
4251 |
test_fn_matches_33
|
|
4252 |
|
|
4253 |
| query result |
|
|
4254 |
|
|
4255 |
query := '
|
|
4256 |
xquery version "1.1";
|
|
4257 |
(: Name: fn-matches-33 :)
|
|
4258 |
(: Description: Evaluation of matches function with "q" flag (allowed in XQuery 1.1 :)
|
|
4259 |
|
|
4260 |
|
|
4261 |
fn:matches("x[y-z]", "x[y-z]", "q")
|
|
4262 |
'.
|
|
4263 |
|
|
4264 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4265 |
|
|
4266 |
|
|
4267 |
result := interpreter evaluate: query.
|
|
4268 |
self
|
|
4269 |
assert: (self xqtsResultTextFromResult: result)
|
|
4270 |
= (self xqtsResultTextFromFile:
|
|
4271 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-33.txt')
|
|
4272 |
|
|
4273 |
"Created: / 11-05-2013 / 19:30:15 / jirka"
|
|
4274 |
!
|
|
4275 |
|
|
4276 |
test_fn_matches_34
|
|
4277 |
|
|
4278 |
| query result |
|
|
4279 |
|
|
4280 |
query := '
|
|
4281 |
xquery version "1.1";
|
|
4282 |
|
|
4283 |
(: Name: fn-matches-33 :)
|
|
4284 |
(: Description: Evaluation of matches function with "q" and "i" flags (allowed in XQuery 1.1 :)
|
|
4285 |
|
|
4286 |
|
|
4287 |
fn:matches("x[Y-z]", "X[y-Z]", "qi")
|
|
4288 |
'.
|
|
4289 |
|
|
4290 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4291 |
|
|
4292 |
|
|
4293 |
result := interpreter evaluate: query.
|
|
4294 |
self
|
|
4295 |
assert: (self xqtsResultTextFromResult: result)
|
|
4296 |
= (self xqtsResultTextFromFile:
|
|
4297 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-34.txt')
|
|
4298 |
|
|
4299 |
"Created: / 11-05-2013 / 19:30:24 / jirka"
|
|
4300 |
!
|
|
4301 |
|
|
4302 |
test_fn_matches_4
|
|
4303 |
|
|
4304 |
| query result |
|
|
4305 |
|
|
4306 |
query := '
|
|
4307 |
(: Name: fn-matches-4 :)
|
|
4308 |
(: Description: Test that calling the function with flags set to the empty string is the same as ommiting the flags.:)
|
|
4309 |
|
|
4310 |
fn:concat(fn:matches("abracadabra", "^bra"),fn:matches("abracadabra", "^bra", ""))
|
|
4311 |
'.
|
|
4312 |
|
|
4313 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4314 |
|
|
4315 |
|
|
4316 |
result := interpreter evaluate: query.
|
|
4317 |
self
|
|
4318 |
assert: (self xqtsResultTextFromResult: result)
|
|
4319 |
= (self xqtsResultTextFromFile:
|
|
4320 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-4.txt')
|
|
4321 |
|
|
4322 |
"Created: / 11-05-2013 / 19:30:34 / jirka"
|
|
4323 |
!
|
|
4324 |
|
|
4325 |
test_fn_matches_5
|
|
4326 |
|
|
4327 |
| query result |
|
|
4328 |
|
|
4329 |
query := '
|
|
4330 |
(: Name: fn-matches-5 :)
|
|
4331 |
(: Description: Evaluate the fn:mathes function with the input string set to the empty sequence.:)
|
|
4332 |
(: fn:count used to avoid empty file. :)
|
|
4333 |
|
|
4334 |
fn:count(fn:matches("()", "^bra"))
|
|
4335 |
'.
|
|
4336 |
|
|
4337 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4338 |
|
|
4339 |
|
|
4340 |
result := interpreter evaluate: query.
|
|
4341 |
self
|
|
4342 |
assert: (self xqtsResultTextFromResult: result)
|
|
4343 |
= (self xqtsResultTextFromFile:
|
|
4344 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-5.txt')
|
|
4345 |
|
|
4346 |
"Created: / 11-05-2013 / 19:30:43 / jirka"
|
|
4347 |
!
|
|
4348 |
|
|
4349 |
test_fn_matches_6
|
|
4350 |
|
|
4351 |
| query result |
|
|
4352 |
|
|
4353 |
query := '
|
|
4354 |
(: Name: fn-matches-6 :)
|
|
4355 |
(: Description: Evaluation of matches function with pattern set to "\^". :)
|
|
4356 |
|
|
4357 |
fn:matches("abracadabra^abracadabra", "\^")
|
|
4358 |
'.
|
|
4359 |
|
|
4360 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4361 |
|
|
4362 |
|
|
4363 |
result := interpreter evaluate: query.
|
|
4364 |
self
|
|
4365 |
assert: (self xqtsResultTextFromResult: result)
|
|
4366 |
= (self xqtsResultTextFromFile:
|
|
4367 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-6.txt')
|
|
4368 |
|
|
4369 |
"Created: / 11-05-2013 / 19:30:52 / jirka"
|
|
4370 |
!
|
|
4371 |
|
|
4372 |
test_fn_matches_7
|
|
4373 |
|
|
4374 |
| query result |
|
|
4375 |
|
|
4376 |
query := '
|
|
4377 |
(: Name: fn-matches-7 :)
|
|
4378 |
(: Description: Evaluation of matches function with pattern set to "\?" for an input string that contains "?". :)
|
|
4379 |
|
|
4380 |
fn:matches("abracadabra?abracadabra", "\?")
|
|
4381 |
'.
|
|
4382 |
|
|
4383 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4384 |
|
|
4385 |
|
|
4386 |
result := interpreter evaluate: query.
|
|
4387 |
self
|
|
4388 |
assert: (self xqtsResultTextFromResult: result)
|
|
4389 |
= (self xqtsResultTextFromFile:
|
|
4390 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-7.txt')
|
|
4391 |
|
|
4392 |
"Created: / 11-05-2013 / 19:31:05 / jirka"
|
|
4393 |
!
|
|
4394 |
|
|
4395 |
test_fn_matches_8
|
|
4396 |
|
|
4397 |
| query result |
|
|
4398 |
|
|
4399 |
query := '
|
|
4400 |
(: Name: fn-matches-8 :)
|
|
4401 |
(: Description: Evaluation of matches function with pattern set to "\*" for an input string that contains "*". :)
|
|
4402 |
|
|
4403 |
fn:matches("abracadabra*abracadabra", "\*")
|
|
4404 |
'.
|
|
4405 |
|
|
4406 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4407 |
|
|
4408 |
|
|
4409 |
result := interpreter evaluate: query.
|
|
4410 |
self
|
|
4411 |
assert: (self xqtsResultTextFromResult: result)
|
|
4412 |
= (self xqtsResultTextFromFile:
|
|
4413 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-8.txt')
|
|
4414 |
|
|
4415 |
"Created: / 11-05-2013 / 19:31:16 / jirka"
|
|
4416 |
!
|
|
4417 |
|
|
4418 |
test_fn_matches_9
|
|
4419 |
|
|
4420 |
| query result |
|
|
4421 |
|
|
4422 |
query := '
|
|
4423 |
(: Name: fn-matches-9 :)
|
|
4424 |
(: Description: Evaluation of matches function with pattern set to "\+" for an input string that contains "+". :)
|
|
4425 |
|
|
4426 |
fn:matches("abracadabra+abracadabra", "\+")
|
|
4427 |
'.
|
|
4428 |
|
|
4429 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4430 |
|
|
4431 |
|
|
4432 |
result := interpreter evaluate: query.
|
|
4433 |
self
|
|
4434 |
assert: (self xqtsResultTextFromResult: result)
|
|
4435 |
= (self xqtsResultTextFromFile:
|
|
4436 |
'Functions/AllStringFunc/MatchStringFunc/MatchesFunc/fn-matches-9.txt')
|
|
4437 |
|
|
4438 |
"Created: / 11-05-2013 / 19:31:28 / jirka"
|
|
4439 |
!
|
|
4440 |
|
|
4441 |
test_fn_starts_with2args_1
|
|
4442 |
|
|
4443 |
| query result |
|
|
4444 |
|
|
4445 |
query := '
|
|
4446 |
(:*******************************************************:)
|
|
4447 |
(:Test: starts-with2args-1 :)
|
|
4448 |
(:Written By: Carmelo Montanez :)
|
|
4449 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
4450 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4451 |
(: with the arguments set as follows: :)
|
|
4452 |
(:$arg1 = xs:string(lower bound) :)
|
|
4453 |
(:$arg2 = xs:string(lower bound) :)
|
|
4454 |
(:*******************************************************:)
|
|
4455 |
|
|
4456 |
fn:starts-with(xs:string("This is a characte"),xs:string("This is a characte"))
|
|
4457 |
'.
|
|
4458 |
|
|
4459 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4460 |
|
|
4461 |
|
|
4462 |
result := interpreter evaluate: query.
|
|
4463 |
self
|
|
4464 |
assert: (self xqtsResultTextFromResult: result)
|
|
4465 |
= (self xqtsResultTextFromFile:
|
|
4466 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with2args-1.txt')
|
|
4467 |
|
|
4468 |
"Created: / 11-05-2013 / 22:59:43 / houzvjir@fel.cvut.cz"
|
|
4469 |
!
|
|
4470 |
|
|
4471 |
test_fn_starts_with2args_2
|
|
4472 |
|
|
4473 |
| query result |
|
|
4474 |
|
|
4475 |
query := '
|
|
4476 |
(:*******************************************************:)
|
|
4477 |
(:Test: starts-with2args-2 :)
|
|
4478 |
(:Written By: Carmelo Montanez :)
|
|
4479 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
4480 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4481 |
(: with the arguments set as follows: :)
|
|
4482 |
(:$arg1 = xs:string(mid range) :)
|
|
4483 |
(:$arg2 = xs:string(lower bound) :)
|
|
4484 |
(:*******************************************************:)
|
|
4485 |
|
|
4486 |
fn:starts-with(xs:string("This is a characte"),xs:string("This is a characte"))
|
|
4487 |
'.
|
|
4488 |
|
|
4489 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4490 |
|
|
4491 |
|
|
4492 |
result := interpreter evaluate: query.
|
|
4493 |
self
|
|
4494 |
assert: (self xqtsResultTextFromResult: result)
|
|
4495 |
= (self xqtsResultTextFromFile:
|
|
4496 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with2args-2.txt')
|
|
4497 |
|
|
4498 |
"Created: / 11-05-2013 / 23:00:30 / houzvjir@fel.cvut.cz"
|
|
4499 |
!
|
|
4500 |
|
|
4501 |
test_fn_starts_with2args_3
|
|
4502 |
|
|
4503 |
| query result |
|
|
4504 |
|
|
4505 |
query := '
|
|
4506 |
(:*******************************************************:)
|
|
4507 |
(:Test: starts-with2args-3 :)
|
|
4508 |
(:Written By: Carmelo Montanez :)
|
|
4509 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
4510 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4511 |
(: with the arguments set as follows: :)
|
|
4512 |
(:$arg1 = xs:string(upper bound) :)
|
|
4513 |
(:$arg2 = xs:string(lower bound) :)
|
|
4514 |
(:*******************************************************:)
|
|
4515 |
|
|
4516 |
fn:starts-with(xs:string("This is a characte"),xs:string("This is a characte"))
|
|
4517 |
'.
|
|
4518 |
|
|
4519 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4520 |
|
|
4521 |
|
|
4522 |
result := interpreter evaluate: query.
|
|
4523 |
self
|
|
4524 |
assert: (self xqtsResultTextFromResult: result)
|
|
4525 |
= (self xqtsResultTextFromFile:
|
|
4526 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with2args-3.txt')
|
|
4527 |
|
|
4528 |
"Created: / 11-05-2013 / 23:01:10 / houzvjir@fel.cvut.cz"
|
|
4529 |
!
|
|
4530 |
|
|
4531 |
test_fn_starts_with2args_4
|
|
4532 |
|
|
4533 |
| query result |
|
|
4534 |
|
|
4535 |
query := '
|
|
4536 |
(:*******************************************************:)
|
|
4537 |
(:Test: starts-with2args-4 :)
|
|
4538 |
(:Written By: Carmelo Montanez :)
|
|
4539 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
4540 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4541 |
(: with the arguments set as follows: :)
|
|
4542 |
(:$arg1 = xs:string(lower bound) :)
|
|
4543 |
(:$arg2 = xs:string(mid range) :)
|
|
4544 |
(:*******************************************************:)
|
|
4545 |
|
|
4546 |
fn:starts-with(xs:string("This is a characte"),xs:string("This is a characte"))
|
|
4547 |
'.
|
|
4548 |
|
|
4549 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4550 |
|
|
4551 |
|
|
4552 |
result := interpreter evaluate: query.
|
|
4553 |
self
|
|
4554 |
assert: (self xqtsResultTextFromResult: result)
|
|
4555 |
= (self xqtsResultTextFromFile:
|
|
4556 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with2args-4.txt')
|
|
4557 |
|
|
4558 |
"Created: / 11-05-2013 / 23:01:41 / houzvjir@fel.cvut.cz"
|
|
4559 |
!
|
|
4560 |
|
|
4561 |
test_fn_starts_with2args_5
|
|
4562 |
|
|
4563 |
| query result |
|
|
4564 |
|
|
4565 |
query := '
|
|
4566 |
(:*******************************************************:)
|
|
4567 |
(:Test: starts-with2args-5 :)
|
|
4568 |
(:Written By: Carmelo Montanez :)
|
|
4569 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
4570 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4571 |
(: with the arguments set as follows: :)
|
|
4572 |
(:$arg1 = xs:string(lower bound) :)
|
|
4573 |
(:$arg2 = xs:string(upper bound) :)
|
|
4574 |
(:*******************************************************:)
|
|
4575 |
|
|
4576 |
fn:starts-with(xs:string("This is a characte"),xs:string("This is a characte"))
|
|
4577 |
'.
|
|
4578 |
|
|
4579 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4580 |
|
|
4581 |
|
|
4582 |
result := interpreter evaluate: query.
|
|
4583 |
self
|
|
4584 |
assert: (self xqtsResultTextFromResult: result)
|
|
4585 |
= (self xqtsResultTextFromFile:
|
|
4586 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with2args-5.txt')
|
|
4587 |
|
|
4588 |
"Created: / 11-05-2013 / 23:02:08 / houzvjir@fel.cvut.cz"
|
|
4589 |
!
|
|
4590 |
|
|
4591 |
test_fn_starts_with_1
|
|
4592 |
|
|
4593 |
| query result |
|
|
4594 |
|
|
4595 |
query := '
|
|
4596 |
(:*******************************************************:)
|
|
4597 |
(:Test: fn-starts-with-1 :)
|
|
4598 |
(:Written By: Carmelo Montanez :)
|
|
4599 |
(:Date: Fri May 27, 2005 :)
|
|
4600 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4601 |
(: with the arguments set as follows: :)
|
|
4602 |
(:$arg1 = "" :)
|
|
4603 |
(:$arg2 = "" :)
|
|
4604 |
(:*******************************************************:)
|
|
4605 |
|
|
4606 |
fn:starts-with("","")
|
|
4607 |
'.
|
|
4608 |
|
|
4609 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4610 |
|
|
4611 |
|
|
4612 |
result := interpreter evaluate: query.
|
|
4613 |
self
|
|
4614 |
assert: (self xqtsResultTextFromResult: result)
|
|
4615 |
= (self xqtsResultTextFromFile:
|
|
4616 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-1.txt')
|
|
4617 |
|
|
4618 |
"Created: / 11-05-2013 / 19:37:01 / jirka"
|
|
4619 |
!
|
|
4620 |
|
|
4621 |
test_fn_starts_with_10
|
|
4622 |
|
|
4623 |
| query result |
|
|
4624 |
|
|
4625 |
query := '
|
|
4626 |
(:*******************************************************:)
|
|
4627 |
(:Test: fn-starts-with-10 :)
|
|
4628 |
(:Written By: Carmelo Montanez :)
|
|
4629 |
(:Date: Fri May 27, 2005 :)
|
|
4630 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4631 |
(: with the arguments set as follows: :)
|
|
4632 |
(:$arg1 = " " :)
|
|
4633 |
(:$arg2 = " AAAAABBBBB" :)
|
|
4634 |
(:*******************************************************:)
|
|
4635 |
|
|
4636 |
fn:starts-with(" ","AAAAABBBBB")
|
|
4637 |
'.
|
|
4638 |
|
|
4639 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4640 |
|
|
4641 |
|
|
4642 |
result := interpreter evaluate: query.
|
|
4643 |
self
|
|
4644 |
assert: (self xqtsResultTextFromResult: result)
|
|
4645 |
= (self xqtsResultTextFromFile:
|
|
4646 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-10.txt')
|
|
4647 |
|
|
4648 |
"Created: / 11-05-2013 / 19:37:15 / jirka"
|
|
4649 |
!
|
|
4650 |
|
|
4651 |
test_fn_starts_with_11
|
|
4652 |
|
|
4653 |
| query result |
|
|
4654 |
|
|
4655 |
query := '
|
|
4656 |
(:*******************************************************:)
|
|
4657 |
(:Test: fn-starts-with-11 :)
|
|
4658 |
(:Written By: Carmelo Montanez :)
|
|
4659 |
(:Date: Fri May 27, 2005 :)
|
|
4660 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4661 |
(:using it as a argument of a fn:not - returns false :)
|
|
4662 |
(:*******************************************************:)
|
|
4663 |
|
|
4664 |
fn:not(fn:starts-with("A","A"))
|
|
4665 |
'.
|
|
4666 |
|
|
4667 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4668 |
|
|
4669 |
|
|
4670 |
result := interpreter evaluate: query.
|
|
4671 |
self
|
|
4672 |
assert: (self xqtsResultTextFromResult: result)
|
|
4673 |
= (self xqtsResultTextFromFile:
|
|
4674 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-11.txt')
|
|
4675 |
|
|
4676 |
"Created: / 11-05-2013 / 19:37:25 / jirka"
|
|
4677 |
!
|
|
4678 |
|
|
4679 |
test_fn_starts_with_12
|
|
4680 |
|
|
4681 |
| query result |
|
|
4682 |
|
|
4683 |
query := '
|
|
4684 |
(:*******************************************************:)
|
|
4685 |
(:Test: fn-starts-with-12 :)
|
|
4686 |
(:Written By: Carmelo Montanez :)
|
|
4687 |
(:Date: Fri May 27, 2005 :)
|
|
4688 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4689 |
(:using it as a argument of a fn:not - returns true :)
|
|
4690 |
(:*******************************************************:)
|
|
4691 |
|
|
4692 |
fn:not(fn:starts-with("A","B"))
|
|
4693 |
'.
|
|
4694 |
|
|
4695 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4696 |
|
|
4697 |
|
|
4698 |
result := interpreter evaluate: query.
|
|
4699 |
self
|
|
4700 |
assert: (self xqtsResultTextFromResult: result)
|
|
4701 |
= (self xqtsResultTextFromFile:
|
|
4702 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-12.txt')
|
|
4703 |
|
|
4704 |
"Created: / 11-05-2013 / 19:37:36 / jirka"
|
|
4705 |
!
|
|
4706 |
|
|
4707 |
test_fn_starts_with_13
|
|
4708 |
|
|
4709 |
| query result |
|
|
4710 |
|
|
4711 |
query := '
|
|
4712 |
(:*******************************************************:)
|
|
4713 |
(:Test: fn-starts-with-13 :)
|
|
4714 |
(:Written By: Carmelo Montanez :)
|
|
4715 |
(:Date: Fri May 27, 2005 :)
|
|
4716 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4717 |
(: with the arguments set as follows: :)
|
|
4718 |
(:$arg1 = xs:string("A") :)
|
|
4719 |
(:$arg2 = "A" :)
|
|
4720 |
(:*******************************************************:)
|
|
4721 |
|
|
4722 |
fn:starts-with(xs:string("A"),"A")
|
|
4723 |
'.
|
|
4724 |
|
|
4725 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4726 |
|
|
4727 |
|
|
4728 |
result := interpreter evaluate: query.
|
|
4729 |
self
|
|
4730 |
assert: (self xqtsResultTextFromResult: result)
|
|
4731 |
= (self xqtsResultTextFromFile:
|
|
4732 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-13.txt')
|
|
4733 |
|
|
4734 |
"Created: / 11-05-2013 / 19:37:45 / jirka"
|
|
4735 |
!
|
|
4736 |
|
|
4737 |
test_fn_starts_with_14
|
|
4738 |
|
|
4739 |
| query result |
|
|
4740 |
|
|
4741 |
query := '
|
|
4742 |
(:*******************************************************:)
|
|
4743 |
(:Test: fn-starts-with-14 :)
|
|
4744 |
(:Written By: Carmelo Montanez :)
|
|
4745 |
(:Date: Fri May 27, 2005 :)
|
|
4746 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4747 |
(: with the arguments set as follows: :)
|
|
4748 |
(:$arg1 = "A" :)
|
|
4749 |
(:$arg2 = xs:string("A") :)
|
|
4750 |
(:*******************************************************:)
|
|
4751 |
|
|
4752 |
fn:starts-with("A",xs:string("A"))'.
|
|
4753 |
|
|
4754 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4755 |
|
|
4756 |
|
|
4757 |
result := interpreter evaluate: query.
|
|
4758 |
self
|
|
4759 |
assert: (self xqtsResultTextFromResult: result)
|
|
4760 |
= (self xqtsResultTextFromFile:
|
|
4761 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-14.txt')
|
|
4762 |
|
|
4763 |
"Created: / 11-05-2013 / 19:37:56 / jirka"
|
|
4764 |
!
|
|
4765 |
|
|
4766 |
test_fn_starts_with_15
|
|
4767 |
|
|
4768 |
| query result |
|
|
4769 |
|
|
4770 |
query := '
|
|
4771 |
(:*******************************************************:)
|
|
4772 |
(:Test: fn-starts-with-15 :)
|
|
4773 |
(:Written By: Carmelo Montanez :)
|
|
4774 |
(:Date: Fri May 27, 2005 :)
|
|
4775 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4776 |
(: with the arguments set as follows: :)
|
|
4777 |
(:$arg1 = "A" :)
|
|
4778 |
(:$arg2 = "a" :)
|
|
4779 |
(:*******************************************************:)
|
|
4780 |
|
|
4781 |
fn:starts-with("A","a")
|
|
4782 |
'.
|
|
4783 |
|
|
4784 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4785 |
|
|
4786 |
|
|
4787 |
result := interpreter evaluate: query.
|
|
4788 |
self
|
|
4789 |
assert: (self xqtsResultTextFromResult: result)
|
|
4790 |
= (self xqtsResultTextFromFile:
|
|
4791 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-15.txt')
|
|
4792 |
|
|
4793 |
"Created: / 11-05-2013 / 19:38:05 / jirka"
|
|
4794 |
!
|
|
4795 |
|
|
4796 |
test_fn_starts_with_16
|
|
4797 |
|
|
4798 |
| query result |
|
|
4799 |
|
|
4800 |
query := '
|
|
4801 |
(:*******************************************************:)
|
|
4802 |
(:Test: fn-starts-with-16 :)
|
|
4803 |
(:Written By: Carmelo Montanez :)
|
|
4804 |
(:Date: Fri May 27, 2005 :)
|
|
4805 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4806 |
(: with the arguments set as follows: :)
|
|
4807 |
(:$arg1 = "a" :)
|
|
4808 |
(:$arg2 = "A" :)
|
|
4809 |
(:*******************************************************:)
|
|
4810 |
|
|
4811 |
fn:starts-with("a","A")
|
|
4812 |
'.
|
|
4813 |
|
|
4814 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4815 |
|
|
4816 |
|
|
4817 |
result := interpreter evaluate: query.
|
|
4818 |
self
|
|
4819 |
assert: (self xqtsResultTextFromResult: result)
|
|
4820 |
= (self xqtsResultTextFromFile:
|
|
4821 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-16.txt')
|
|
4822 |
|
|
4823 |
"Created: / 11-05-2013 / 19:38:14 / jirka"
|
|
4824 |
!
|
|
4825 |
|
|
4826 |
test_fn_starts_with_2
|
|
4827 |
|
|
4828 |
| query result |
|
|
4829 |
|
|
4830 |
query := '
|
|
4831 |
(:*******************************************************:)
|
|
4832 |
(:Test: fn-starts-with-2 :)
|
|
4833 |
(:Written By: Carmelo Montanez :)
|
|
4834 |
(:Date: Fri May 27, 2005 :)
|
|
4835 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4836 |
(: with the arguments set as follows: :)
|
|
4837 |
(:$arg1 = "" :)
|
|
4838 |
(:$arg2 = "A Character String" :)
|
|
4839 |
(:*******************************************************:)
|
|
4840 |
|
|
4841 |
fn:starts-with("","A Character String")
|
|
4842 |
'.
|
|
4843 |
|
|
4844 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4845 |
|
|
4846 |
|
|
4847 |
result := interpreter evaluate: query.
|
|
4848 |
self
|
|
4849 |
assert: (self xqtsResultTextFromResult: result)
|
|
4850 |
= (self xqtsResultTextFromFile:
|
|
4851 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-2.txt')
|
|
4852 |
|
|
4853 |
"Created: / 11-05-2013 / 19:38:23 / jirka"
|
|
4854 |
!
|
|
4855 |
|
|
4856 |
test_fn_starts_with_3
|
|
4857 |
|
|
4858 |
| query result |
|
|
4859 |
|
|
4860 |
query := '
|
|
4861 |
(:*******************************************************:)
|
|
4862 |
(:Test: fn-starts-with-3 :)
|
|
4863 |
(:Written By: Carmelo Montanez :)
|
|
4864 |
(:Date: Fri May 27, 2005 :)
|
|
4865 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4866 |
(: with the arguments set as follows: :)
|
|
4867 |
(:$arg1 = "" :)
|
|
4868 |
(:$arg2 = "A Character String" :)
|
|
4869 |
(:*******************************************************:)
|
|
4870 |
|
|
4871 |
fn:starts-with("A Character String","")
|
|
4872 |
'.
|
|
4873 |
|
|
4874 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4875 |
|
|
4876 |
|
|
4877 |
result := interpreter evaluate: query.
|
|
4878 |
self
|
|
4879 |
assert: (self xqtsResultTextFromResult: result)
|
|
4880 |
= (self xqtsResultTextFromFile:
|
|
4881 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-3.txt')
|
|
4882 |
|
|
4883 |
"Created: / 11-05-2013 / 19:38:38 / jirka"
|
|
4884 |
!
|
|
4885 |
|
|
4886 |
test_fn_starts_with_4
|
|
4887 |
|
|
4888 |
| query result |
|
|
4889 |
|
|
4890 |
query := '
|
|
4891 |
(:*******************************************************:)
|
|
4892 |
(:Test: fn-starts-with-4 :)
|
|
4893 |
(:Written By: Carmelo Montanez :)
|
|
4894 |
(:Date: Fri May 27, 2005 :)
|
|
4895 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4896 |
(: with the arguments set as follows: :)
|
|
4897 |
(:$arg1 = () :)
|
|
4898 |
(:$arg2 = "" :)
|
|
4899 |
(:*******************************************************:)
|
|
4900 |
|
|
4901 |
fn:starts-with((),"")
|
|
4902 |
'.
|
|
4903 |
|
|
4904 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4905 |
|
|
4906 |
|
|
4907 |
result := interpreter evaluate: query.
|
|
4908 |
self
|
|
4909 |
assert: (self xqtsResultTextFromResult: result)
|
|
4910 |
= (self xqtsResultTextFromFile:
|
|
4911 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-4.txt')
|
|
4912 |
|
|
4913 |
"Created: / 11-05-2013 / 19:38:48 / jirka"
|
|
4914 |
!
|
|
4915 |
|
|
4916 |
test_fn_starts_with_5
|
|
4917 |
|
|
4918 |
| query result |
|
|
4919 |
|
|
4920 |
query := '
|
|
4921 |
(:*******************************************************:)
|
|
4922 |
(:Test: fn-starts-with-5 :)
|
|
4923 |
(:Written By: Carmelo Montanez :)
|
|
4924 |
(:Date: Fri May 27, 2005 :)
|
|
4925 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4926 |
(: with the arguments set as follows: :)
|
|
4927 |
(:$arg1 = "" :)
|
|
4928 |
(:$arg2 = () :)
|
|
4929 |
(:*******************************************************:)
|
|
4930 |
|
|
4931 |
fn:starts-with("",())
|
|
4932 |
'.
|
|
4933 |
|
|
4934 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4935 |
|
|
4936 |
|
|
4937 |
result := interpreter evaluate: query.
|
|
4938 |
self
|
|
4939 |
assert: (self xqtsResultTextFromResult: result)
|
|
4940 |
= (self xqtsResultTextFromFile:
|
|
4941 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-5.txt')
|
|
4942 |
|
|
4943 |
"Created: / 11-05-2013 / 19:39:11 / jirka"
|
|
4944 |
!
|
|
4945 |
|
|
4946 |
test_fn_starts_with_6
|
|
4947 |
|
|
4948 |
| query result |
|
|
4949 |
|
|
4950 |
query := '
|
|
4951 |
(:*******************************************************:)
|
|
4952 |
(:Test: fn-starts-with-6 :)
|
|
4953 |
(:Written By: Carmelo Montanez :)
|
|
4954 |
(:Date: Fri May 27, 2005 :)
|
|
4955 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4956 |
(: with the arguments set as follows: :)
|
|
4957 |
(:$arg1 = "A Character String" :)
|
|
4958 |
(:$arg2 = () :)
|
|
4959 |
(:*******************************************************:)
|
|
4960 |
|
|
4961 |
fn:starts-with("A Character String",())
|
|
4962 |
'.
|
|
4963 |
|
|
4964 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4965 |
|
|
4966 |
|
|
4967 |
result := interpreter evaluate: query.
|
|
4968 |
self
|
|
4969 |
assert: (self xqtsResultTextFromResult: result)
|
|
4970 |
= (self xqtsResultTextFromFile:
|
|
4971 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-6.txt')
|
|
4972 |
|
|
4973 |
"Created: / 11-05-2013 / 19:39:24 / jirka"
|
|
4974 |
!
|
|
4975 |
|
|
4976 |
test_fn_starts_with_7
|
|
4977 |
|
|
4978 |
| query result |
|
|
4979 |
|
|
4980 |
query := '
|
|
4981 |
(:*******************************************************:)
|
|
4982 |
(:Test: fn-starts-with-7 :)
|
|
4983 |
(:Written By: Carmelo Montanez :)
|
|
4984 |
(:Date: Fri May 27, 2005 :)
|
|
4985 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
4986 |
(: with the arguments set as follows: :)
|
|
4987 |
(:$arg1 = () :)
|
|
4988 |
(:$arg2 = "A Character String" :)
|
|
4989 |
(:*******************************************************:)
|
|
4990 |
|
|
4991 |
fn:starts-with((),"A Character String")
|
|
4992 |
'.
|
|
4993 |
|
|
4994 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
4995 |
|
|
4996 |
|
|
4997 |
result := interpreter evaluate: query.
|
|
4998 |
self
|
|
4999 |
assert: (self xqtsResultTextFromResult: result)
|
|
5000 |
= (self xqtsResultTextFromFile:
|
|
5001 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-7.txt')
|
|
5002 |
|
|
5003 |
"Created: / 11-05-2013 / 19:39:31 / jirka"
|
|
5004 |
!
|
|
5005 |
|
|
5006 |
test_fn_starts_with_8
|
|
5007 |
|
|
5008 |
| query result |
|
|
5009 |
|
|
5010 |
query := '
|
|
5011 |
(:*******************************************************:)
|
|
5012 |
(:Test: fn-starts-with-8 :)
|
|
5013 |
(:Written By: Carmelo Montanez :)
|
|
5014 |
(:Date: Fri May 27, 2005 :)
|
|
5015 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
5016 |
(: with the arguments set as follows: :)
|
|
5017 |
(:$arg1 = "AAAAABBBBBCCCCC" :)
|
|
5018 |
(:$arg2 = "BBBBB" :)
|
|
5019 |
(:*******************************************************:)
|
|
5020 |
|
|
5021 |
fn:starts-with("AAAAABBBBBCCCCC","BBBBB")
|
|
5022 |
'.
|
|
5023 |
|
|
5024 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5025 |
|
|
5026 |
|
|
5027 |
result := interpreter evaluate: query.
|
|
5028 |
self
|
|
5029 |
assert: (self xqtsResultTextFromResult: result)
|
|
5030 |
= (self xqtsResultTextFromFile:
|
|
5031 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-8.txt')
|
|
5032 |
|
|
5033 |
"Created: / 11-05-2013 / 19:39:40 / jirka"
|
|
5034 |
!
|
|
5035 |
|
|
5036 |
test_fn_starts_with_9
|
|
5037 |
|
|
5038 |
| query result |
|
|
5039 |
|
|
5040 |
query := '
|
|
5041 |
(:*******************************************************:)
|
|
5042 |
(:Test: fn-starts-with-9 :)
|
|
5043 |
(:Written By: Carmelo Montanez :)
|
|
5044 |
(:Date: Fri May 27, 2005 :)
|
|
5045 |
(:Purpose: Evaluates The "starts-with" function :)
|
|
5046 |
(: with the arguments set as follows: :)
|
|
5047 |
(:$arg1 = "AAAAABBBBB" :)
|
|
5048 |
(:$arg2 = " " :)
|
|
5049 |
(:*******************************************************:)
|
|
5050 |
|
|
5051 |
fn:starts-with("AAAAABBBBB"," ")
|
|
5052 |
'.
|
|
5053 |
|
|
5054 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5055 |
|
|
5056 |
result := interpreter evaluate: query.
|
|
5057 |
self
|
|
5058 |
assert: (self xqtsResultTextFromResult: result)
|
|
5059 |
= (self xqtsResultTextFromFile:
|
|
5060 |
'Functions/AllStringFunc/SubstringStringFunc/StartsWithFunc/fn-starts-with-9.txt')
|
|
5061 |
|
|
5062 |
"Created: / 11-05-2013 / 19:39:51 / jirka"
|
|
5063 |
"Modified: / 12-05-2013 / 12:40:40 / houzvjir@fel.cvut.cz"
|
|
5064 |
!
|
|
5065 |
|
|
5066 |
test_fn_string_length1args_1
|
|
5067 |
|
|
5068 |
| query result |
|
|
5069 |
|
|
5070 |
query := '
|
|
5071 |
(:*******************************************************:)
|
|
5072 |
(:Test: string-length1args-1 :)
|
|
5073 |
(:Written By: Carmelo Montanez :)
|
|
5074 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
5075 |
(:Purpose: Evaluates The "string-length" function :)
|
|
5076 |
(: with the arguments set as follows: :)
|
|
5077 |
(:$arg = xs:string(lower bound) :)
|
|
5078 |
(:*******************************************************:)
|
|
5079 |
|
|
5080 |
fn:string-length(xs:string("This is a characte"))
|
|
5081 |
|
|
5082 |
'.
|
|
5083 |
|
|
5084 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5085 |
|
|
5086 |
result := interpreter evaluate: query.
|
|
5087 |
|
|
5088 |
self
|
|
5089 |
assert: (self xqtsResultTextFromResult: result)
|
|
5090 |
= (self xqtsResultTextFromFile:
|
|
5091 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length1args-1.txt')
|
|
5092 |
|
|
5093 |
"Created: / 12-05-2013 / 13:18:59 / houzvjir@fel.cvut.cz"
|
|
5094 |
!
|
|
5095 |
|
|
5096 |
test_fn_string_length1args_2
|
|
5097 |
|
|
5098 |
| query result |
|
|
5099 |
|
|
5100 |
query := '
|
|
5101 |
(:*******************************************************:)
|
|
5102 |
(:Test: string-length1args-2 :)
|
|
5103 |
(:Written By: Carmelo Montanez :)
|
|
5104 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
5105 |
(:Purpose: Evaluates The "string-length" function :)
|
|
5106 |
(: with the arguments set as follows: :)
|
|
5107 |
(:$arg = xs:string(mid range) :)
|
|
5108 |
(:*******************************************************:)
|
|
5109 |
|
|
5110 |
fn:string-length(xs:string("This is a characte"))
|
|
5111 |
|
|
5112 |
'.
|
|
5113 |
|
|
5114 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5115 |
|
|
5116 |
result := interpreter evaluate: query.
|
|
5117 |
|
|
5118 |
self
|
|
5119 |
assert: (self xqtsResultTextFromResult: result)
|
|
5120 |
= (self xqtsResultTextFromFile:
|
|
5121 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length1args-2.txt')
|
|
5122 |
|
|
5123 |
"Created: / 12-05-2013 / 13:21:24 / houzvjir@fel.cvut.cz"
|
|
5124 |
!
|
|
5125 |
|
|
5126 |
test_fn_string_length1args_3
|
|
5127 |
|
|
5128 |
| query result |
|
|
5129 |
|
|
5130 |
query := '
|
|
5131 |
(:*******************************************************:)
|
|
5132 |
(:Test: string-length1args-3 :)
|
|
5133 |
(:Written By: Carmelo Montanez :)
|
|
5134 |
(:Date: Fri Dec 10 10:15:46 GMT-05:00 2004 :)
|
|
5135 |
(:Purpose: Evaluates The "string-length" function :)
|
|
5136 |
(: with the arguments set as follows: :)
|
|
5137 |
(:$arg = xs:string(upper bound) :)
|
|
5138 |
(:*******************************************************:)
|
|
5139 |
|
|
5140 |
fn:string-length(xs:string("This is a characte"))
|
|
5141 |
|
|
5142 |
'.
|
|
5143 |
|
|
5144 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5145 |
|
|
5146 |
result := interpreter evaluate: query.
|
|
5147 |
|
|
5148 |
self
|
|
5149 |
assert: (self xqtsResultTextFromResult: result)
|
|
5150 |
= (self xqtsResultTextFromFile:
|
|
5151 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length1args-3.txt')
|
|
5152 |
|
|
5153 |
"Created: / 12-05-2013 / 13:22:16 / houzvjir@fel.cvut.cz"
|
|
5154 |
!
|
|
5155 |
|
|
5156 |
test_fn_string_length_1
|
|
5157 |
|
|
5158 |
| query result |
|
|
5159 |
|
|
5160 |
query := '
|
|
5161 |
(: Name: fn-string-length-1 :)
|
|
5162 |
(: Description: Evaluation of string-length function as per example 1 (for this function) :)
|
|
5163 |
(: from the F&O specs. :)
|
|
5164 |
|
|
5165 |
fn:string-length("Harp not on that string, madam; that is past.")
|
|
5166 |
'.
|
|
5167 |
|
|
5168 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5169 |
|
|
5170 |
result := interpreter evaluate: query.
|
|
5171 |
|
|
5172 |
self
|
|
5173 |
assert: (self xqtsResultTextFromResult: result)
|
|
5174 |
= (self xqtsResultTextFromFile:
|
|
5175 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-1.txt')
|
|
5176 |
|
|
5177 |
"Created: / 12-05-2013 / 12:20:28 / houzvjir@fel.cvut.cz"
|
|
5178 |
"Modified: / 18-05-2013 / 13:14:03 / houzvjir@fel.cvut.cz"
|
|
5179 |
!
|
|
5180 |
|
|
5181 |
test_fn_string_length_10
|
|
5182 |
|
|
5183 |
| query result |
|
|
5184 |
|
|
5185 |
query := '
|
|
5186 |
(: Name: fn-string-length-10 :)
|
|
5187 |
(: Description: Evaluation of string-length function with argument set to "*****":)
|
|
5188 |
|
|
5189 |
fn:string-length("*****")
|
|
5190 |
'.
|
|
5191 |
|
|
5192 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5193 |
|
|
5194 |
result := interpreter evaluate: query.
|
|
5195 |
|
|
5196 |
self
|
|
5197 |
assert: (self xqtsResultTextFromResult: result)
|
|
5198 |
= (self xqtsResultTextFromFile:
|
|
5199 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-10.txt')
|
|
5200 |
|
|
5201 |
"Created: / 12-05-2013 / 12:55:05 / houzvjir@fel.cvut.cz"
|
|
5202 |
!
|
|
5203 |
|
|
5204 |
test_fn_string_length_11
|
|
5205 |
|
|
5206 |
| query result |
|
|
5207 |
|
|
5208 |
query := '
|
|
5209 |
(: Name: fn-string-length-11 :)
|
|
5210 |
(: Description: Evaluation of string-length function as part of an addition operation:)
|
|
5211 |
|
|
5212 |
fn:string-length("zzzzz") + fn:string-length("zzzzz")
|
|
5213 |
'.
|
|
5214 |
|
|
5215 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5216 |
|
|
5217 |
result := interpreter evaluate: query.
|
|
5218 |
|
|
5219 |
self
|
|
5220 |
assert: (self xqtsResultTextFromResult: result)
|
|
5221 |
= (self xqtsResultTextFromFile:
|
|
5222 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-11.txt')
|
|
5223 |
|
|
5224 |
"Created: / 12-05-2013 / 12:56:04 / houzvjir@fel.cvut.cz"
|
|
5225 |
!
|
|
5226 |
|
|
5227 |
test_fn_string_length_12
|
|
5228 |
|
|
5229 |
| query result |
|
|
5230 |
|
|
5231 |
query := '
|
|
5232 |
(: Name: fn-string-length-12 :)
|
|
5233 |
(: Description: Evaluation of string-length function as an argument to the "fn:boolean" function:)
|
|
5234 |
|
|
5235 |
fn:boolean(fn:string-length("abcde"))
|
|
5236 |
'.
|
|
5237 |
|
|
5238 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5239 |
|
|
5240 |
result := interpreter evaluate: query.
|
|
5241 |
|
|
5242 |
self
|
|
5243 |
assert: (self xqtsResultTextFromResult: result)
|
|
5244 |
= (self xqtsResultTextFromFile:
|
|
5245 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-12.txt')
|
|
5246 |
|
|
5247 |
"Created: / 12-05-2013 / 12:56:28 / houzvjir@fel.cvut.cz"
|
|
5248 |
!
|
|
5249 |
|
|
5250 |
test_fn_string_length_13
|
|
5251 |
|
|
5252 |
| query result |
|
|
5253 |
|
|
5254 |
query := '
|
|
5255 |
(: Name: fn-string-length-13 :)
|
|
5256 |
(: Description: Evaluation of string-length function as an argument to the "fn:concat" function:)
|
|
5257 |
|
|
5258 |
fn:concat(fn:string-length("abcde"), fn:string-length("fghi"))
|
|
5259 |
'.
|
|
5260 |
|
|
5261 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5262 |
|
|
5263 |
result := interpreter evaluate: query.
|
|
5264 |
|
|
5265 |
self
|
|
5266 |
assert: (self xqtsResultTextFromResult: result)
|
|
5267 |
= (self xqtsResultTextFromFile:
|
|
5268 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-13.txt')
|
|
5269 |
|
|
5270 |
"Created: / 12-05-2013 / 12:56:49 / houzvjir@fel.cvut.cz"
|
|
5271 |
!
|
|
5272 |
|
|
5273 |
test_fn_string_length_14
|
|
5274 |
|
|
5275 |
| query result |
|
|
5276 |
|
|
5277 |
query := '
|
|
5278 |
(: Name: fn-string-length-14 :)
|
|
5279 |
(: Description: Evaluation of string-length function as an argument to the "fn:not" function:)
|
|
5280 |
|
|
5281 |
fn:not(fn:string-length("abcde"))
|
|
5282 |
'.
|
|
5283 |
|
|
5284 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5285 |
|
|
5286 |
result := interpreter evaluate: query.
|
|
5287 |
|
|
5288 |
self
|
|
5289 |
assert: (self xqtsResultTextFromResult: result)
|
|
5290 |
= (self xqtsResultTextFromFile:
|
|
5291 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-14.txt')
|
|
5292 |
|
|
5293 |
"Created: / 12-05-2013 / 12:57:14 / houzvjir@fel.cvut.cz"
|
|
5294 |
!
|
|
5295 |
|
|
5296 |
test_fn_string_length_15
|
|
5297 |
|
|
5298 |
| query result |
|
|
5299 |
|
|
5300 |
query := '
|
|
5301 |
(: Name: fn-string-length-15 :)
|
|
5302 |
(: Description: Evaluation of string-length function with argument set to "%$#@!!":)
|
|
5303 |
|
|
5304 |
fn:string-length("%$#@!!")
|
|
5305 |
'.
|
|
5306 |
|
|
5307 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5308 |
|
|
5309 |
result := interpreter evaluate: query.
|
|
5310 |
|
|
5311 |
self
|
|
5312 |
assert: (self xqtsResultTextFromResult: result)
|
|
5313 |
= (self xqtsResultTextFromFile:
|
|
5314 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-15.txt')
|
|
5315 |
|
|
5316 |
"Created: / 12-05-2013 / 12:57:40 / houzvjir@fel.cvut.cz"
|
|
5317 |
!
|
|
5318 |
|
|
5319 |
test_fn_string_length_16
|
|
5320 |
|
|
5321 |
| query result |
|
|
5322 |
|
|
5323 |
query := '
|
|
5324 |
(: Name: fn-string-length-16 :)
|
|
5325 |
(: Description: Evaluation of string-length function with argument set to "string-length":)
|
|
5326 |
|
|
5327 |
fn:string-length("string-length") '.
|
|
5328 |
|
|
5329 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5330 |
|
|
5331 |
result := interpreter evaluate: query.
|
|
5332 |
|
|
5333 |
self
|
|
5334 |
assert: (self xqtsResultTextFromResult: result)
|
|
5335 |
= (self xqtsResultTextFromFile:
|
|
5336 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-16.txt')
|
|
5337 |
|
|
5338 |
"Created: / 12-05-2013 / 12:58:18 / houzvjir@fel.cvut.cz"
|
|
5339 |
!
|
|
5340 |
|
|
5341 |
test_fn_string_length_17
|
|
5342 |
|
|
5343 |
| query result |
|
|
5344 |
|
|
5345 |
query := '
|
|
5346 |
(: Name: fn-string-length-17 :)
|
|
5347 |
(: Description: Evaluation of string-length function as part of a boolean expression:)
|
|
5348 |
|
|
5349 |
fn:string-length("abc") and fn:string-length("abc")'.
|
|
5350 |
|
|
5351 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5352 |
|
|
5353 |
result := interpreter evaluate: query.
|
|
5354 |
|
|
5355 |
self
|
|
5356 |
assert: (self xqtsResultTextFromResult: result)
|
|
5357 |
= (self xqtsResultTextFromFile:
|
|
5358 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-17.txt')
|
|
5359 |
|
|
5360 |
"Created: / 12-05-2013 / 13:00:38 / houzvjir@fel.cvut.cz"
|
|
5361 |
!
|
|
5362 |
|
|
5363 |
test_fn_string_length_18
|
|
5364 |
|
|
5365 |
| query result |
|
|
5366 |
|
|
5367 |
query := '
|
|
5368 |
(: Name: fn-string-length-18 :)
|
|
5369 |
(: Description: Evaluation of string-length function with no argument and no context item defined. :)
|
|
5370 |
|
|
5371 |
declare namespace eg = "http://example.org";
|
|
5372 |
|
|
5373 |
declare function eg:noContextFunction()
|
|
5374 |
{
|
|
5375 |
fn:string-length()
|
|
5376 |
};
|
|
5377 |
|
|
5378 |
eg:noContextFunction()
|
|
5379 |
'.
|
|
5380 |
|
|
5381 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5382 |
|
|
5383 |
result := interpreter evaluate: query.
|
|
5384 |
|
|
5385 |
self
|
|
5386 |
assert: (self xqtsResultTextFromResult: result)
|
|
5387 |
= (self xqtsResultTextFromFile:
|
|
5388 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-18.txt')
|
|
5389 |
|
|
5390 |
"Created: / 12-05-2013 / 13:01:17 / houzvjir@fel.cvut.cz"
|
|
5391 |
!
|
|
5392 |
|
|
5393 |
test_fn_string_length_19
|
|
5394 |
|
|
5395 |
| query result |
|
|
5396 |
|
|
5397 |
query := '
|
|
5398 |
(:*******************************************************:)
|
|
5399 |
(: Name: fn-string-length-19 :)
|
|
5400 |
(: Written By: Nicolae Brinza :)
|
|
5401 |
(: Description: Evaluation of string-length function with:)
|
|
5402 |
(: an argument that is a sequence of more than one item :)
|
|
5403 |
|
|
5404 |
(: insert-start :)
|
|
5405 |
declare variable $input-context external;
|
|
5406 |
(: insert-end :)
|
|
5407 |
|
|
5408 |
fn:string-length( $input-context//location )
|
|
5409 |
|
|
5410 |
'.
|
|
5411 |
|
|
5412 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5413 |
|
|
5414 |
result := interpreter evaluate: query.
|
|
5415 |
|
|
5416 |
self
|
|
5417 |
assert: (self xqtsResultTextFromResult: result)
|
|
5418 |
= (self xqtsResultTextFromFile:
|
|
5419 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-19.txt')
|
|
5420 |
|
|
5421 |
"Created: / 12-05-2013 / 13:17:04 / houzvjir@fel.cvut.cz"
|
|
5422 |
!
|
|
5423 |
|
|
5424 |
test_fn_string_length_2
|
|
5425 |
|
|
5426 |
| query result |
|
|
5427 |
|
|
5428 |
query := '
|
|
5429 |
(: Name: fn-string-length-2 :)
|
|
5430 |
(: Description: Evaluation of string-length function using the empty sequence :)
|
|
5431 |
|
|
5432 |
fn:string-length(())
|
|
5433 |
'.
|
|
5434 |
|
|
5435 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5436 |
|
|
5437 |
result := interpreter evaluate: query.
|
|
5438 |
|
|
5439 |
self
|
|
5440 |
assert: (self xqtsResultTextFromResult: result)
|
|
5441 |
= (self xqtsResultTextFromFile:
|
|
5442 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-2.txt')
|
|
5443 |
|
|
5444 |
"Created: / 12-05-2013 / 12:39:09 / houzvjir@fel.cvut.cz"
|
|
5445 |
"Modified: / 18-05-2013 / 13:22:27 / houzvjir@fel.cvut.cz"
|
|
5446 |
!
|
|
5447 |
|
|
5448 |
test_fn_string_length_3
|
|
5449 |
|
|
5450 |
| query result |
|
|
5451 |
|
|
5452 |
query := '
|
|
5453 |
(: Name: fn-string-length-3 :)
|
|
5454 |
(: Description: Evaluation of string-length function that uses only numbers as part of argument:)
|
|
5455 |
|
|
5456 |
fn:string-length("12345")
|
|
5457 |
'.
|
|
5458 |
|
|
5459 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5460 |
|
|
5461 |
result := interpreter evaluate: query.
|
|
5462 |
|
|
5463 |
self
|
|
5464 |
assert: (self xqtsResultTextFromResult: result)
|
|
5465 |
= (self xqtsResultTextFromFile:
|
|
5466 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-3.txt')
|
|
5467 |
|
|
5468 |
"Created: / 12-05-2013 / 12:44:33 / houzvjir@fel.cvut.cz"
|
|
5469 |
"Modified: / 18-05-2013 / 13:15:36 / houzvjir@fel.cvut.cz"
|
|
5470 |
!
|
|
5471 |
|
|
5472 |
test_fn_string_length_4
|
|
5473 |
|
|
5474 |
| query result |
|
|
5475 |
|
|
5476 |
query := '
|
|
5477 |
(: Name: fn-string-length-4 :)
|
|
5478 |
(: Description: Evaluation of string-length function that uses both numbers and letters as part of argument:)
|
|
5479 |
|
|
5480 |
fn:string-length("12345abcd")
|
|
5481 |
'.
|
|
5482 |
|
|
5483 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5484 |
|
|
5485 |
result := interpreter evaluate: query.
|
|
5486 |
|
|
5487 |
self
|
|
5488 |
assert: (self xqtsResultTextFromResult: result)
|
|
5489 |
= (self xqtsResultTextFromFile:
|
|
5490 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-4.txt')
|
|
5491 |
|
|
5492 |
"Created: / 12-05-2013 / 12:51:52 / houzvjir@fel.cvut.cz"
|
|
5493 |
"Modified: / 18-05-2013 / 13:16:12 / houzvjir@fel.cvut.cz"
|
|
5494 |
!
|
|
5495 |
|
|
5496 |
test_fn_string_length_5
|
|
5497 |
|
|
5498 |
| query result |
|
|
5499 |
|
|
5500 |
query := '
|
|
5501 |
(: Name: fn-string-length-5 :)
|
|
5502 |
(: Description: Evaluation of string-length function that uses only upper case letters as part of argument:)
|
|
5503 |
|
|
5504 |
fn:string-length("ABCD")
|
|
5505 |
'.
|
|
5506 |
|
|
5507 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5508 |
|
|
5509 |
result := interpreter evaluate: query.
|
|
5510 |
|
|
5511 |
self
|
|
5512 |
assert: (self xqtsResultTextFromResult: result)
|
|
5513 |
= (self xqtsResultTextFromFile:
|
|
5514 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-5.txt')
|
|
5515 |
|
|
5516 |
"Created: / 12-05-2013 / 12:52:46 / houzvjir@fel.cvut.cz"
|
|
5517 |
"Modified: / 18-05-2013 / 13:16:33 / houzvjir@fel.cvut.cz"
|
|
5518 |
!
|
|
5519 |
|
|
5520 |
test_fn_string_length_6
|
|
5521 |
|
|
5522 |
| query result |
|
|
5523 |
|
|
5524 |
query := '
|
|
5525 |
(: Name: fn-string-length-6 :)
|
|
5526 |
(: Description: Evaluation of string-length function that uses only lower case letters as part of argument:)
|
|
5527 |
|
|
5528 |
fn:string-length("abcde") '.
|
|
5529 |
|
|
5530 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5531 |
|
|
5532 |
result := interpreter evaluate: query.
|
|
5533 |
|
|
5534 |
self
|
|
5535 |
assert: (self xqtsResultTextFromResult: result)
|
|
5536 |
= (self xqtsResultTextFromFile:
|
|
5537 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-6.txt')
|
|
5538 |
|
|
5539 |
"Created: / 12-05-2013 / 12:53:10 / houzvjir@fel.cvut.cz"
|
|
5540 |
"Modified: / 18-05-2013 / 13:16:46 / houzvjir@fel.cvut.cz"
|
|
5541 |
!
|
|
5542 |
|
|
5543 |
test_fn_string_length_7
|
|
5544 |
|
|
5545 |
| query result |
|
|
5546 |
|
|
5547 |
query := '
|
|
5548 |
(: Name: fn-string-length-7 :)
|
|
5549 |
(: Description: Evaluation of string-length function that uses both upper and lower case letters as part of argument:)
|
|
5550 |
|
|
5551 |
fn:string-length("ABCDEabcde")
|
|
5552 |
'.
|
|
5553 |
|
|
5554 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5555 |
|
|
5556 |
result := interpreter evaluate: query.
|
|
5557 |
|
|
5558 |
self
|
|
5559 |
assert: (self xqtsResultTextFromResult: result)
|
|
5560 |
= (self xqtsResultTextFromFile:
|
|
5561 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-7.txt')
|
|
5562 |
|
|
5563 |
"Created: / 12-05-2013 / 12:53:44 / houzvjir@fel.cvut.cz"
|
|
5564 |
"Modified: / 18-05-2013 / 13:17:05 / houzvjir@fel.cvut.cz"
|
|
5565 |
!
|
|
5566 |
|
|
5567 |
test_fn_string_length_8
|
|
5568 |
|
|
5569 |
| query result |
|
|
5570 |
|
|
5571 |
query := '
|
|
5572 |
(: Name: fn-string-length-8 :)
|
|
5573 |
(: Description: Evaluation of string-length function that uses the empty string as part of argument:)
|
|
5574 |
|
|
5575 |
fn:string-length("")
|
|
5576 |
'.
|
|
5577 |
|
|
5578 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5579 |
|
|
5580 |
result := interpreter evaluate: query.
|
|
5581 |
|
|
5582 |
self
|
|
5583 |
assert: (self xqtsResultTextFromResult: result)
|
|
5584 |
= (self xqtsResultTextFromFile:
|
|
5585 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-8.txt')
|
|
5586 |
|
|
5587 |
"Created: / 12-05-2013 / 12:54:22 / houzvjir@fel.cvut.cz"
|
|
5588 |
"Modified: / 18-05-2013 / 13:17:18 / houzvjir@fel.cvut.cz"
|
|
5589 |
!
|
|
5590 |
|
|
5591 |
test_fn_string_length_9
|
|
5592 |
|
|
5593 |
| query result |
|
|
5594 |
|
|
5595 |
query := '
|
|
5596 |
(: Name: fn-string-length-9 :)
|
|
5597 |
(: Description: Evaluation of string-length function that uses the "string" as part of argument:)
|
|
5598 |
|
|
5599 |
fn:string-length(fn:string("AbcDH"))
|
|
5600 |
'.
|
|
5601 |
|
|
5602 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5603 |
|
|
5604 |
result := interpreter evaluate: query.
|
|
5605 |
|
|
5606 |
self
|
|
5607 |
assert: (self xqtsResultTextFromResult: result)
|
|
5608 |
= (self xqtsResultTextFromFile:
|
|
5609 |
'Functions/AllStringFunc/GeneralStringFunc/StringLengthFunc/fn-string-length-9.txt')
|
|
5610 |
|
|
5611 |
"Created: / 12-05-2013 / 12:54:32 / houzvjir@fel.cvut.cz"
|
|
5612 |
"Modified: / 18-05-2013 / 13:18:26 / houzvjir@fel.cvut.cz"
|
|
5613 |
!
|
|
5614 |
|
|
5615 |
test_fn_substring_1
|
|
5616 |
|
|
5617 |
| query result |
|
|
5618 |
|
|
5619 |
query := '
|
|
5620 |
(: Name: fn-substring-1 :)
|
|
5621 |
(: Description: Evaluation of substring function as per example 1 (for this function) :)
|
|
5622 |
(: from the F&O specs. :)
|
|
5623 |
|
|
5624 |
fn:substring("motor car", 6)
|
|
5625 |
'.
|
|
5626 |
|
|
5627 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5628 |
|
|
5629 |
|
|
5630 |
result := interpreter evaluate: query.
|
|
5631 |
self
|
|
5632 |
assert: (self xqtsResultTextFromResult: result)
|
|
5633 |
= (self xqtsResultTextFromFile:
|
|
5634 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-1.txt')
|
|
5635 |
|
|
5636 |
"Created: / 09-05-2013 / 14:11:02 / houzvjir@fel.cvut.cz"
|
|
5637 |
!
|
|
5638 |
|
|
5639 |
test_fn_substring_10
|
|
5640 |
|
|
5641 |
| query result |
|
|
5642 |
|
|
5643 |
query := '
|
|
5644 |
(: Name: fn-substring-10 :)
|
|
5645 |
(: Description: Evaluation of substring function as per example 10 (for this function) :)
|
|
5646 |
(: from the F&O specs. :)
|
|
5647 |
|
|
5648 |
fn:substring("12345", -42, 1 div 0E0)
|
|
5649 |
'.
|
|
5650 |
|
|
5651 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5652 |
|
|
5653 |
|
|
5654 |
result := interpreter evaluate: query.
|
|
5655 |
self
|
|
5656 |
assert: (self xqtsResultTextFromResult: result)
|
|
5657 |
= (self xqtsResultTextFromFile:
|
|
5658 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-10.txt')
|
|
5659 |
|
|
5660 |
"Created: / 09-05-2013 / 14:16:11 / houzvjir@fel.cvut.cz"
|
|
5661 |
!
|
|
5662 |
|
|
5663 |
test_fn_substring_11
|
|
5664 |
|
|
5665 |
| query result |
|
|
5666 |
|
|
5667 |
query := '
|
|
5668 |
(: Name: fn-substring-11 :)
|
|
5669 |
(: Description: Evaluation of substring function as per example 11 (for this function) :)
|
|
5670 |
(: from the F&O specs. Use "fn:count" to avoid empty file. :)
|
|
5671 |
|
|
5672 |
fn:count(fn:substring("12345", -1 div 0E0, 1 div 0E0))
|
|
5673 |
'.
|
|
5674 |
|
|
5675 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5676 |
|
|
5677 |
|
|
5678 |
result := interpreter evaluate: query.
|
|
5679 |
self
|
|
5680 |
assert: (self xqtsResultTextFromResult: result)
|
|
5681 |
= (self xqtsResultTextFromFile:
|
|
5682 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-11.txt')
|
|
5683 |
|
|
5684 |
"Created: / 09-05-2013 / 14:16:33 / houzvjir@fel.cvut.cz"
|
|
5685 |
!
|
|
5686 |
|
|
5687 |
test_fn_substring_12
|
|
5688 |
|
|
5689 |
| query result |
|
|
5690 |
|
|
5691 |
query := '
|
|
5692 |
(: Name: fn-substring-12 :)
|
|
5693 |
(: Description: Evaluation of substring function, where the source string is the empty string :)
|
|
5694 |
(: Use "fn:count" to avoid empty file. :)
|
|
5695 |
|
|
5696 |
fn:count(fn:substring("",0))
|
|
5697 |
'.
|
|
5698 |
|
|
5699 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5700 |
|
|
5701 |
|
|
5702 |
result := interpreter evaluate: query.
|
|
5703 |
self
|
|
5704 |
assert: (self xqtsResultTextFromResult: result)
|
|
5705 |
= (self xqtsResultTextFromFile:
|
|
5706 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-12.txt')
|
|
5707 |
|
|
5708 |
"Created: / 09-05-2013 / 14:17:07 / houzvjir@fel.cvut.cz"
|
|
5709 |
!
|
|
5710 |
|
|
5711 |
test_fn_substring_13
|
|
5712 |
|
|
5713 |
| query result |
|
|
5714 |
|
|
5715 |
query := '
|
|
5716 |
(: Name: fn-substring-13 :)
|
|
5717 |
(: Description: Evaluation of substring function, as an argument to an "fn:boolean" function" :)
|
|
5718 |
|
|
5719 |
fn:boolean(fn:substring("ABC",1))
|
|
5720 |
'.
|
|
5721 |
|
|
5722 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5723 |
|
|
5724 |
|
|
5725 |
result := interpreter evaluate: query.
|
|
5726 |
self
|
|
5727 |
assert: (self xqtsResultTextFromResult: result)
|
|
5728 |
= (self xqtsResultTextFromFile:
|
|
5729 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-13.txt')
|
|
5730 |
|
|
5731 |
"Created: / 09-05-2013 / 14:17:30 / houzvjir@fel.cvut.cz"
|
|
5732 |
!
|
|
5733 |
|
|
5734 |
test_fn_substring_14
|
|
5735 |
|
|
5736 |
| query result |
|
|
5737 |
|
|
5738 |
query := '
|
|
5739 |
(: Name: fn-substring-14 :)
|
|
5740 |
(: Description: Evaluation of substring function, as an argument to an "fn:not" function" :)
|
|
5741 |
|
|
5742 |
fn:not(fn:substring("ABC",1))
|
|
5743 |
'.
|
|
5744 |
|
|
5745 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5746 |
|
|
5747 |
|
|
5748 |
result := interpreter evaluate: query.
|
|
5749 |
self
|
|
5750 |
assert: (self xqtsResultTextFromResult: result)
|
|
5751 |
= (self xqtsResultTextFromFile:
|
|
5752 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-14.txt')
|
|
5753 |
|
|
5754 |
"Created: / 09-05-2013 / 14:17:57 / houzvjir@fel.cvut.cz"
|
|
5755 |
!
|
|
5756 |
|
|
5757 |
test_fn_substring_15
|
|
5758 |
|
|
5759 |
| query result |
|
|
5760 |
|
|
5761 |
query := '
|
|
5762 |
(: Name: fn-substring-15 :)
|
|
5763 |
(: Description: Evaluation of substring function, as an argument to another "fn:substring" function" :)
|
|
5764 |
|
|
5765 |
fn:substring(fn:substring("ABCDE",1),1)
|
|
5766 |
'.
|
|
5767 |
|
|
5768 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5769 |
|
|
5770 |
|
|
5771 |
result := interpreter evaluate: query.
|
|
5772 |
self
|
|
5773 |
assert: (self xqtsResultTextFromResult: result)
|
|
5774 |
= (self xqtsResultTextFromFile:
|
|
5775 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-15.txt')
|
|
5776 |
|
|
5777 |
"Created: / 09-05-2013 / 14:18:17 / houzvjir@fel.cvut.cz"
|
|
5778 |
!
|
|
5779 |
|
|
5780 |
test_fn_substring_16
|
|
5781 |
|
|
5782 |
| query result |
|
|
5783 |
|
|
5784 |
query := '
|
|
5785 |
(: Name: fn-substring-16 :)
|
|
5786 |
(: Description: Evaluation of substring function, where the source string is the string "substring".:)
|
|
5787 |
|
|
5788 |
fn:substring("substring",1)
|
|
5789 |
'.
|
|
5790 |
|
|
5791 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5792 |
|
|
5793 |
|
|
5794 |
result := interpreter evaluate: query.
|
|
5795 |
self
|
|
5796 |
assert: (self xqtsResultTextFromResult: result)
|
|
5797 |
= (self xqtsResultTextFromFile:
|
|
5798 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-16.txt')
|
|
5799 |
|
|
5800 |
"Created: / 09-05-2013 / 14:18:36 / houzvjir@fel.cvut.cz"
|
|
5801 |
!
|
|
5802 |
|
|
5803 |
test_fn_substring_17
|
|
5804 |
|
|
5805 |
| query result |
|
|
5806 |
|
|
5807 |
query := '
|
|
5808 |
(: Name: fn-substring-17 :)
|
|
5809 |
(: Description: Evaluation of substring function as an argument to a concat function.:)
|
|
5810 |
|
|
5811 |
fn:concat(fn:substring("ABC",1),"DEF")
|
|
5812 |
'.
|
|
5813 |
|
|
5814 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5815 |
|
|
5816 |
|
|
5817 |
result := interpreter evaluate: query.
|
|
5818 |
self
|
|
5819 |
assert: (self xqtsResultTextFromResult: result)
|
|
5820 |
= (self xqtsResultTextFromFile:
|
|
5821 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-17.txt')
|
|
5822 |
|
|
5823 |
"Created: / 09-05-2013 / 14:18:54 / houzvjir@fel.cvut.cz"
|
|
5824 |
!
|
|
5825 |
|
|
5826 |
test_fn_substring_18
|
|
5827 |
|
|
5828 |
| query result |
|
|
5829 |
|
|
5830 |
query := '
|
|
5831 |
(: Name: fn-substring-18:)
|
|
5832 |
(: Description: Evaluation of substring function as an argument to a contains function.:)
|
|
5833 |
|
|
5834 |
fn:contains(fn:substring("ABCDEF",1),"DEF")
|
|
5835 |
'.
|
|
5836 |
|
|
5837 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5838 |
|
|
5839 |
|
|
5840 |
result := interpreter evaluate: query.
|
|
5841 |
self
|
|
5842 |
assert: (self xqtsResultTextFromResult: result)
|
|
5843 |
= (self xqtsResultTextFromFile:
|
|
5844 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-18.txt')
|
|
5845 |
|
|
5846 |
"Created: / 09-05-2013 / 14:19:12 / houzvjir@fel.cvut.cz"
|
|
5847 |
!
|
|
5848 |
|
|
5849 |
test_fn_substring_19
|
|
5850 |
|
|
5851 |
| query result |
|
|
5852 |
|
|
5853 |
query := '
|
|
5854 |
(: Name: fn-substring-19:)
|
|
5855 |
(: Description: Evaluation of substring function using the special chracter "!!@#$%^&*()".:)
|
|
5856 |
|
|
5857 |
fn:substring("!!@#$%^*()",1)
|
|
5858 |
'.
|
|
5859 |
|
|
5860 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5861 |
|
|
5862 |
|
|
5863 |
result := interpreter evaluate: query.
|
|
5864 |
self
|
|
5865 |
assert: (self xqtsResultTextFromResult: result)
|
|
5866 |
= (self xqtsResultTextFromFile:
|
|
5867 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-19.txt')
|
|
5868 |
|
|
5869 |
"Created: / 09-05-2013 / 14:19:34 / houzvjir@fel.cvut.cz"
|
|
5870 |
!
|
|
5871 |
|
|
5872 |
test_fn_substring_2
|
|
5873 |
|
|
5874 |
| query result |
|
|
5875 |
|
|
5876 |
query := '
|
|
5877 |
(: Name: fn-substring-2 :)
|
|
5878 |
(: Description: Evaluation of substring function as per example 2 (for this function) :)
|
|
5879 |
(: from the F&O specs. :)
|
|
5880 |
|
|
5881 |
fn:substring("metadata", 4, 3)
|
|
5882 |
'.
|
|
5883 |
|
|
5884 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5885 |
|
|
5886 |
|
|
5887 |
result := interpreter evaluate: query.
|
|
5888 |
self
|
|
5889 |
assert: (self xqtsResultTextFromResult: result)
|
|
5890 |
= (self xqtsResultTextFromFile:
|
|
5891 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-2.txt')
|
|
5892 |
|
|
5893 |
"Created: / 09-05-2013 / 14:12:01 / houzvjir@fel.cvut.cz"
|
|
5894 |
!
|
|
5895 |
|
|
5896 |
test_fn_substring_20
|
|
5897 |
|
|
5898 |
| query result |
|
|
5899 |
|
|
5900 |
query := '
|
|
5901 |
(: Name: fn-substring-20:)
|
|
5902 |
(: Description: Evaluation of substring function, where the start location uses a "double" constructor.:)
|
|
5903 |
|
|
5904 |
fn:substring("ABCD",xs:double(1))
|
|
5905 |
'.
|
|
5906 |
|
|
5907 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5908 |
|
|
5909 |
|
|
5910 |
result := interpreter evaluate: query.
|
|
5911 |
self
|
|
5912 |
assert: (self xqtsResultTextFromResult: result)
|
|
5913 |
= (self xqtsResultTextFromFile:
|
|
5914 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-20.txt')
|
|
5915 |
|
|
5916 |
"Created: / 09-05-2013 / 14:20:08 / houzvjir@fel.cvut.cz"
|
|
5917 |
!
|
|
5918 |
|
|
5919 |
test_fn_substring_21
|
|
5920 |
|
|
5921 |
| query result |
|
|
5922 |
|
|
5923 |
query := '
|
|
5924 |
(: Name: fn-substring-21:)
|
|
5925 |
(: Description: Evaluation of substring function, where the starting locatin is an addition expression. :)
|
|
5926 |
|
|
5927 |
fn:substring("ABCDE",1+1)
|
|
5928 |
'.
|
|
5929 |
|
|
5930 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5931 |
|
|
5932 |
|
|
5933 |
result := interpreter evaluate: query.
|
|
5934 |
self
|
|
5935 |
assert: (self xqtsResultTextFromResult: result)
|
|
5936 |
= (self xqtsResultTextFromFile:
|
|
5937 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-21.txt')
|
|
5938 |
|
|
5939 |
"Created: / 09-05-2013 / 14:20:33 / houzvjir@fel.cvut.cz"
|
|
5940 |
!
|
|
5941 |
|
|
5942 |
test_fn_substring_3
|
|
5943 |
|
|
5944 |
| query result |
|
|
5945 |
|
|
5946 |
query := '
|
|
5947 |
(: Name: fn-substring-3 :)
|
|
5948 |
(: Description: Evaluation of substring function as per example 3 (for this function) :)
|
|
5949 |
(: from the F&O specs. :)
|
|
5950 |
|
|
5951 |
fn:substring("12345", 1.5, 2.6)
|
|
5952 |
'.
|
|
5953 |
|
|
5954 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5955 |
|
|
5956 |
|
|
5957 |
result := interpreter evaluate: query.
|
|
5958 |
self
|
|
5959 |
assert: (self xqtsResultTextFromResult: result)
|
|
5960 |
= (self xqtsResultTextFromFile:
|
|
5961 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-3.txt')
|
|
5962 |
|
|
5963 |
"Created: / 09-05-2013 / 14:12:22 / houzvjir@fel.cvut.cz"
|
|
5964 |
!
|
|
5965 |
|
|
5966 |
test_fn_substring_4
|
|
5967 |
|
|
5968 |
| query result |
|
|
5969 |
|
|
5970 |
query := '
|
|
5971 |
(: Name: fn-substring-4 :)
|
|
5972 |
(: Description: Evaluation of substring function as per example 4 (for this function) :)
|
|
5973 |
(: from the F&O specs. :)
|
|
5974 |
|
|
5975 |
fn:substring("12345", 0, 3)
|
|
5976 |
'.
|
|
5977 |
|
|
5978 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
5979 |
|
|
5980 |
|
|
5981 |
result := interpreter evaluate: query.
|
|
5982 |
self
|
|
5983 |
assert: (self xqtsResultTextFromResult: result)
|
|
5984 |
= (self xqtsResultTextFromFile:
|
|
5985 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-4.txt')
|
|
5986 |
|
|
5987 |
"Created: / 09-05-2013 / 14:13:09 / houzvjir@fel.cvut.cz"
|
|
5988 |
!
|
|
5989 |
|
|
5990 |
test_fn_substring_5
|
|
5991 |
|
|
5992 |
| query result |
|
|
5993 |
|
|
5994 |
query := '
|
|
5995 |
(: Name: fn-substring-5 :)
|
|
5996 |
(: Description: Evaluation of substring function as per example 5 (for this function) :)
|
|
5997 |
(: from the F&O specs. Use "fn:count" to avoid empty file. :)
|
|
5998 |
|
|
5999 |
fn:count(fn:substring("12345", 5, -3))
|
|
6000 |
'.
|
|
6001 |
|
|
6002 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6003 |
|
|
6004 |
|
|
6005 |
result := interpreter evaluate: query.
|
|
6006 |
self
|
|
6007 |
assert: (self xqtsResultTextFromResult: result)
|
|
6008 |
= (self xqtsResultTextFromFile:
|
|
6009 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-5.txt')
|
|
6010 |
|
|
6011 |
"Created: / 09-05-2013 / 14:13:52 / houzvjir@fel.cvut.cz"
|
|
6012 |
!
|
|
6013 |
|
|
6014 |
test_fn_substring_6
|
|
6015 |
|
|
6016 |
| query result |
|
|
6017 |
|
|
6018 |
query := '
|
|
6019 |
(: Name: fn-substring-6 :)
|
|
6020 |
(: Description: Evaluation of substring function as per example 6 (for this function) :)
|
|
6021 |
(: from the F&O specs. :)
|
|
6022 |
|
|
6023 |
fn:substring("12345", -3, 5)
|
|
6024 |
'.
|
|
6025 |
|
|
6026 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6027 |
|
|
6028 |
|
|
6029 |
result := interpreter evaluate: query.
|
|
6030 |
self
|
|
6031 |
assert: (self xqtsResultTextFromResult: result)
|
|
6032 |
= (self xqtsResultTextFromFile:
|
|
6033 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-6.txt')
|
|
6034 |
|
|
6035 |
"Created: / 09-05-2013 / 14:14:28 / houzvjir@fel.cvut.cz"
|
|
6036 |
!
|
|
6037 |
|
|
6038 |
test_fn_substring_7
|
|
6039 |
|
|
6040 |
| query result |
|
|
6041 |
|
|
6042 |
query := '
|
|
6043 |
(: Name: fn-substring-7 :)
|
|
6044 |
(: Description: Evaluation of substring function as per example 7 (for this function) :)
|
|
6045 |
(: from the F&O specs. Use "fn:count" to avoid empty file. :)
|
|
6046 |
|
|
6047 |
fn:count(fn:substring("12345", 0 div 0E0, 3))
|
|
6048 |
'.
|
|
6049 |
|
|
6050 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6051 |
|
|
6052 |
|
|
6053 |
result := interpreter evaluate: query.
|
|
6054 |
self
|
|
6055 |
assert: (self xqtsResultTextFromResult: result)
|
|
6056 |
= (self xqtsResultTextFromFile:
|
|
6057 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-7.txt')
|
|
6058 |
|
|
6059 |
"Created: / 09-05-2013 / 14:14:55 / houzvjir@fel.cvut.cz"
|
|
6060 |
!
|
|
6061 |
|
|
6062 |
test_fn_substring_8
|
|
6063 |
|
|
6064 |
| query result |
|
|
6065 |
|
|
6066 |
query := '
|
|
6067 |
(: Name: fn-substring-8 :)
|
|
6068 |
(: Description: Evaluation of substring function as per example 8 (for this function) :)
|
|
6069 |
(: from the F&O specs. Use "fn:count" to avoid empty file. :)
|
|
6070 |
|
|
6071 |
fn:count(fn:substring("12345", 1, 0 div 0E0))
|
|
6072 |
'.
|
|
6073 |
|
|
6074 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6075 |
|
|
6076 |
|
|
6077 |
result := interpreter evaluate: query.
|
|
6078 |
self
|
|
6079 |
assert: (self xqtsResultTextFromResult: result)
|
|
6080 |
= (self xqtsResultTextFromFile:
|
|
6081 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-8.txt')
|
|
6082 |
|
|
6083 |
"Created: / 09-05-2013 / 14:15:22 / houzvjir@fel.cvut.cz"
|
|
6084 |
!
|
|
6085 |
|
|
6086 |
test_fn_substring_9
|
|
6087 |
|
|
6088 |
| query result |
|
|
6089 |
|
|
6090 |
query := '
|
|
6091 |
(: Name: fn-substring-9 :)
|
|
6092 |
(: Description: Evaluation of substring function as per example 9 (for this function) :)
|
|
6093 |
(: from the F&O specs. Use "fn:count" to avoid empty file. :)
|
|
6094 |
|
|
6095 |
fn:count(fn:substring((), 1, 3))
|
|
6096 |
'.
|
|
6097 |
|
|
6098 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6099 |
|
|
6100 |
|
|
6101 |
result := interpreter evaluate: query.
|
|
6102 |
self
|
|
6103 |
assert: (self xqtsResultTextFromResult: result)
|
|
6104 |
= (self xqtsResultTextFromFile:
|
|
6105 |
'Functions/AllStringFunc/GeneralStringFunc/SubstringFunc/fn-substring-9.txt')
|
|
6106 |
|
|
6107 |
"Created: / 09-05-2013 / 14:15:44 / houzvjir@fel.cvut.cz"
|
|
6108 |
!
|
|
6109 |
|
|
6110 |
test_fn_substring_after_1
|
|
6111 |
|
|
6112 |
| query result |
|
|
6113 |
|
|
6114 |
query := '
|
|
6115 |
(:*******************************************************:)
|
|
6116 |
(:Test: fn-substring-after-1 :)
|
|
6117 |
(:Written By: Carmelo Montanez :)
|
|
6118 |
(:Date: Fri May 27, 2005 :)
|
|
6119 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6120 |
(: with the arguments set as follows: :)
|
|
6121 |
(:$arg1 = "" :)
|
|
6122 |
(:$arg2 = "" :)
|
|
6123 |
(:*******************************************************:)
|
|
6124 |
|
|
6125 |
fn:count(fn:substring-after("",""))
|
|
6126 |
'.
|
|
6127 |
|
|
6128 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6129 |
|
|
6130 |
|
|
6131 |
result := interpreter evaluate: query.
|
|
6132 |
self
|
|
6133 |
assert: (self xqtsResultTextFromResult: result)
|
|
6134 |
= (self xqtsResultTextFromFile:
|
|
6135 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-1.txt')
|
|
6136 |
|
|
6137 |
"Created: / 11-05-2013 / 19:40:00 / jirka"
|
|
6138 |
!
|
|
6139 |
|
|
6140 |
test_fn_substring_after_10
|
|
6141 |
|
|
6142 |
| query result |
|
|
6143 |
|
|
6144 |
query := '
|
|
6145 |
(:*******************************************************:)
|
|
6146 |
(:Test: fn-substring-after-10 :)
|
|
6147 |
(:Written By: Carmelo Montanez :)
|
|
6148 |
(:Date: Fri May 27, 2005 :)
|
|
6149 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6150 |
(: with the arguments set as follows: :)
|
|
6151 |
(:$arg1 = " " :)
|
|
6152 |
(:$arg2 = " AAAAABBBBB" :)
|
|
6153 |
(:*******************************************************:)
|
|
6154 |
|
|
6155 |
fn:count(fn:substring-after(" ","AAAAABBBBB"))
|
|
6156 |
'.
|
|
6157 |
|
|
6158 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6159 |
|
|
6160 |
|
|
6161 |
result := interpreter evaluate: query.
|
|
6162 |
self
|
|
6163 |
assert: (self xqtsResultTextFromResult: result)
|
|
6164 |
= (self xqtsResultTextFromFile:
|
|
6165 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-10.txt')
|
|
6166 |
|
|
6167 |
"Created: / 11-05-2013 / 19:40:16 / jirka"
|
|
6168 |
!
|
|
6169 |
|
|
6170 |
test_fn_substring_after_11
|
|
6171 |
|
|
6172 |
| query result |
|
|
6173 |
|
|
6174 |
query := '
|
|
6175 |
(:*******************************************************:)
|
|
6176 |
(:Test: fn-substring-after-11 :)
|
|
6177 |
(:Written By: Carmelo Montanez :)
|
|
6178 |
(:Date: Fri May 27, 2005 :)
|
|
6179 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6180 |
(:using it as a argument of a fn:not - returns true :)
|
|
6181 |
(:*******************************************************:)
|
|
6182 |
|
|
6183 |
fn:not(fn:substring-after("A","A"))
|
|
6184 |
'.
|
|
6185 |
|
|
6186 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6187 |
|
|
6188 |
|
|
6189 |
result := interpreter evaluate: query.
|
|
6190 |
self
|
|
6191 |
assert: (self xqtsResultTextFromResult: result)
|
|
6192 |
= (self xqtsResultTextFromFile:
|
|
6193 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-11.txt')
|
|
6194 |
|
|
6195 |
"Created: / 11-05-2013 / 19:40:26 / jirka"
|
|
6196 |
!
|
|
6197 |
|
|
6198 |
test_fn_substring_after_12
|
|
6199 |
|
|
6200 |
| query result |
|
|
6201 |
|
|
6202 |
query := '
|
|
6203 |
(:*******************************************************:)
|
|
6204 |
(:Test: fn-substring-after-12 :)
|
|
6205 |
(:Written By: Carmelo Montanez :)
|
|
6206 |
(:Date: Fri May 27, 2005 :)
|
|
6207 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6208 |
(:using it as a argument of a fn:not - returns true :)
|
|
6209 |
(:*******************************************************:)
|
|
6210 |
|
|
6211 |
fn:not(fn:substring-after("A","B"))
|
|
6212 |
'.
|
|
6213 |
|
|
6214 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6215 |
|
|
6216 |
|
|
6217 |
result := interpreter evaluate: query.
|
|
6218 |
self
|
|
6219 |
assert: (self xqtsResultTextFromResult: result)
|
|
6220 |
= (self xqtsResultTextFromFile:
|
|
6221 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-12.txt')
|
|
6222 |
|
|
6223 |
"Created: / 11-05-2013 / 19:40:34 / jirka"
|
|
6224 |
!
|
|
6225 |
|
|
6226 |
test_fn_substring_after_13
|
|
6227 |
|
|
6228 |
| query result |
|
|
6229 |
|
|
6230 |
query := '
|
|
6231 |
(:*******************************************************:)
|
|
6232 |
(:Test: fn-substring-after-13 :)
|
|
6233 |
(:Written By: Carmelo Montanez :)
|
|
6234 |
(:Date: Fri May 27, 2005 :)
|
|
6235 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6236 |
(: with the arguments set as follows: :)
|
|
6237 |
(:$arg1 = xs:string("A") :)
|
|
6238 |
(:$arg2 = "A" :)
|
|
6239 |
(:*******************************************************:)
|
|
6240 |
|
|
6241 |
fn:count(fn:substring-after(xs:string("A"),"A"))
|
|
6242 |
'.
|
|
6243 |
|
|
6244 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6245 |
|
|
6246 |
|
|
6247 |
result := interpreter evaluate: query.
|
|
6248 |
self
|
|
6249 |
assert: (self xqtsResultTextFromResult: result)
|
|
6250 |
= (self xqtsResultTextFromFile:
|
|
6251 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-13.txt')
|
|
6252 |
|
|
6253 |
"Created: / 11-05-2013 / 19:40:41 / jirka"
|
|
6254 |
!
|
|
6255 |
|
|
6256 |
test_fn_substring_after_14
|
|
6257 |
|
|
6258 |
| query result |
|
|
6259 |
|
|
6260 |
query := '
|
|
6261 |
(:*******************************************************:)
|
|
6262 |
(:Test: fn-substring-after-14 :)
|
|
6263 |
(:Written By: Carmelo Montanez :)
|
|
6264 |
(:Date: Fri May 27, 2005 :)
|
|
6265 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6266 |
(: with the arguments set as follows: :)
|
|
6267 |
(:$arg1 = "A" :)
|
|
6268 |
(:$arg2 = xs:string("A") :)
|
|
6269 |
(:*******************************************************:)
|
|
6270 |
|
|
6271 |
fn:count(fn:substring-after("A",xs:string("A")))
|
|
6272 |
'.
|
|
6273 |
|
|
6274 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6275 |
|
|
6276 |
|
|
6277 |
result := interpreter evaluate: query.
|
|
6278 |
self
|
|
6279 |
assert: (self xqtsResultTextFromResult: result)
|
|
6280 |
= (self xqtsResultTextFromFile:
|
|
6281 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-14.txt')
|
|
6282 |
|
|
6283 |
"Created: / 11-05-2013 / 19:40:49 / jirka"
|
|
6284 |
!
|
|
6285 |
|
|
6286 |
test_fn_substring_after_15
|
|
6287 |
|
|
6288 |
| query result |
|
|
6289 |
|
|
6290 |
query := '
|
|
6291 |
(:*******************************************************:)
|
|
6292 |
(:Test: fn-substring-after-15 :)
|
|
6293 |
(:Written By: Carmelo Montanez :)
|
|
6294 |
(:Date: Fri May 27, 2005 :)
|
|
6295 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6296 |
(: with the arguments set as follows: :)
|
|
6297 |
(:$arg1 = "A" :)
|
|
6298 |
(:$arg2 = "a" :)
|
|
6299 |
(:*******************************************************:)
|
|
6300 |
|
|
6301 |
fn:count(fn:substring-after("A","a"))
|
|
6302 |
'.
|
|
6303 |
|
|
6304 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6305 |
|
|
6306 |
|
|
6307 |
result := interpreter evaluate: query.
|
|
6308 |
self
|
|
6309 |
assert: (self xqtsResultTextFromResult: result)
|
|
6310 |
= (self xqtsResultTextFromFile:
|
|
6311 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-15.txt')
|
|
6312 |
|
|
6313 |
"Created: / 11-05-2013 / 19:40:58 / jirka"
|
|
6314 |
!
|
|
6315 |
|
|
6316 |
test_fn_substring_after_16
|
|
6317 |
|
|
6318 |
| query result |
|
|
6319 |
|
|
6320 |
query := '
|
|
6321 |
(:*******************************************************:)
|
|
6322 |
(:Test: fn-substring-after-16 :)
|
|
6323 |
(:Written By: Carmelo Montanez :)
|
|
6324 |
(:Date: Fri May 27, 2005 :)
|
|
6325 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6326 |
(: with the arguments set as follows: :)
|
|
6327 |
(:$arg1 = "a" :)
|
|
6328 |
(:$arg2 = "A" :)
|
|
6329 |
(:*******************************************************:)
|
|
6330 |
|
|
6331 |
fn:count(fn:substring-after("a","A"))
|
|
6332 |
'.
|
|
6333 |
|
|
6334 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6335 |
|
|
6336 |
|
|
6337 |
result := interpreter evaluate: query.
|
|
6338 |
self
|
|
6339 |
assert: (self xqtsResultTextFromResult: result)
|
|
6340 |
= (self xqtsResultTextFromFile:
|
|
6341 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-16.txt')
|
|
6342 |
|
|
6343 |
"Created: / 11-05-2013 / 19:41:07 / jirka"
|
|
6344 |
!
|
|
6345 |
|
|
6346 |
test_fn_substring_after_17
|
|
6347 |
|
|
6348 |
| query result |
|
|
6349 |
|
|
6350 |
query := '
|
|
6351 |
(:*******************************************************:)
|
|
6352 |
(:Test: fn-substring-after-17 :)
|
|
6353 |
(:Written By: Carmelo Montanez :)
|
|
6354 |
(:Date: Mon Jun 1, 2005 :)
|
|
6355 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6356 |
(: with the arguments set as follows: :)
|
|
6357 |
(:$arg1 = "substring-after" :)
|
|
6358 |
(:$arg2 = "substring-after" :)
|
|
6359 |
(:*******************************************************:)
|
|
6360 |
|
|
6361 |
fn:count(fn:substring-after("substring-after","substring-after"))
|
|
6362 |
'.
|
|
6363 |
|
|
6364 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6365 |
|
|
6366 |
|
|
6367 |
result := interpreter evaluate: query.
|
|
6368 |
self
|
|
6369 |
assert: (self xqtsResultTextFromResult: result)
|
|
6370 |
= (self xqtsResultTextFromFile:
|
|
6371 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-17.txt')
|
|
6372 |
|
|
6373 |
"Created: / 11-05-2013 / 19:41:26 / jirka"
|
|
6374 |
!
|
|
6375 |
|
|
6376 |
test_fn_substring_after_18
|
|
6377 |
|
|
6378 |
| query result |
|
|
6379 |
|
|
6380 |
query := '
|
|
6381 |
(:*******************************************************:)
|
|
6382 |
(:Test: fn-substring-after-18 :)
|
|
6383 |
(:Written By: Carmelo Montanez :)
|
|
6384 |
(:Date: Mon Jun 1, 2005 :)
|
|
6385 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6386 |
(: with the arguments set as follows: :)
|
|
6387 |
(:$arg1 = "substring-aftersubstring-after" :)
|
|
6388 |
(:$arg2 = "substring-after" :)
|
|
6389 |
(:*******************************************************:)
|
|
6390 |
|
|
6391 |
fn:substring-after("substring-aftersubstring-after","substring-after")
|
|
6392 |
'.
|
|
6393 |
|
|
6394 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6395 |
|
|
6396 |
|
|
6397 |
result := interpreter evaluate: query.
|
|
6398 |
self
|
|
6399 |
assert: (self xqtsResultTextFromResult: result)
|
|
6400 |
= (self xqtsResultTextFromFile:
|
|
6401 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-18.txt')
|
|
6402 |
|
|
6403 |
"Created: / 11-05-2013 / 19:41:52 / jirka"
|
|
6404 |
!
|
|
6405 |
|
|
6406 |
test_fn_substring_after_19
|
|
6407 |
|
|
6408 |
| query result |
|
|
6409 |
|
|
6410 |
query := '
|
|
6411 |
(:*******************************************************:)
|
|
6412 |
(:Test: fn-substring-after-19 :)
|
|
6413 |
(:Written By: Carmelo Montanez :)
|
|
6414 |
(:Date: Mon Jun 1, 2005 :)
|
|
6415 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6416 |
(: with the arguments set as follows: :)
|
|
6417 |
(:$arg1 = "****" :)
|
|
6418 |
(:$arg2 = "***" :)
|
|
6419 |
(:*******************************************************:)
|
|
6420 |
|
|
6421 |
fn:substring-after("****","***")
|
|
6422 |
'.
|
|
6423 |
|
|
6424 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6425 |
|
|
6426 |
|
|
6427 |
result := interpreter evaluate: query.
|
|
6428 |
self
|
|
6429 |
assert: (self xqtsResultTextFromResult: result)
|
|
6430 |
= (self xqtsResultTextFromFile:
|
|
6431 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-19.txt')
|
|
6432 |
|
|
6433 |
"Created: / 11-05-2013 / 19:42:11 / jirka"
|
|
6434 |
!
|
|
6435 |
|
|
6436 |
test_fn_substring_after_2
|
|
6437 |
|
|
6438 |
| query result |
|
|
6439 |
|
|
6440 |
query := '
|
|
6441 |
(:*******************************************************:)
|
|
6442 |
(:Test: fn-substring-after-2 :)
|
|
6443 |
(:Written By: Carmelo Montanez :)
|
|
6444 |
(:Date: Fri May 27, 2005 :)
|
|
6445 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6446 |
(: with the arguments set as follows: :)
|
|
6447 |
(:$arg1 = "" :)
|
|
6448 |
(:$arg2 = "A Character String" :)
|
|
6449 |
(:*******************************************************:)
|
|
6450 |
|
|
6451 |
fn:count(fn:substring-after("","A Character String"))
|
|
6452 |
'.
|
|
6453 |
|
|
6454 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6455 |
|
|
6456 |
|
|
6457 |
result := interpreter evaluate: query.
|
|
6458 |
self
|
|
6459 |
assert: (self xqtsResultTextFromResult: result)
|
|
6460 |
= (self xqtsResultTextFromFile:
|
|
6461 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-2.txt')
|
|
6462 |
|
|
6463 |
"Created: / 11-05-2013 / 19:42:20 / jirka"
|
|
6464 |
!
|
|
6465 |
|
|
6466 |
test_fn_substring_after_20
|
|
6467 |
|
|
6468 |
| query result |
|
|
6469 |
|
|
6470 |
query := '
|
|
6471 |
(:*******************************************************:)
|
|
6472 |
(:Test: fn-substring-after-20 :)
|
|
6473 |
(:Written By: Carmelo Montanez :)
|
|
6474 |
(:Date: Mon Jun 1, 2005 :)
|
|
6475 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6476 |
(: with the arguments set as follows: :)
|
|
6477 |
(:$arg1 = "12345" :)
|
|
6478 |
(:$arg2 = "1234" :)
|
|
6479 |
(:*******************************************************:)
|
|
6480 |
|
|
6481 |
fn:substring-after("12345","1234")
|
|
6482 |
'.
|
|
6483 |
|
|
6484 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6485 |
|
|
6486 |
|
|
6487 |
result := interpreter evaluate: query.
|
|
6488 |
self
|
|
6489 |
assert: (self xqtsResultTextFromResult: result)
|
|
6490 |
= (self xqtsResultTextFromFile:
|
|
6491 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-20.txt')
|
|
6492 |
|
|
6493 |
"Created: / 11-05-2013 / 19:42:30 / jirka"
|
|
6494 |
!
|
|
6495 |
|
|
6496 |
test_fn_substring_after_21
|
|
6497 |
|
|
6498 |
| query result |
|
|
6499 |
|
|
6500 |
query := '
|
|
6501 |
(:*******************************************************:)
|
|
6502 |
(:Test: fn-substring-after-21 :)
|
|
6503 |
(:Written By: Carmelo Montanez :)
|
|
6504 |
(:Date: Mon Jun 1, 2005 :)
|
|
6505 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6506 |
(: with the arguments set as follows: :)
|
|
6507 |
(:$arg1 = "substring-after :)
|
|
6508 |
(:$arg2 = "refta-gnirtsbus :)
|
|
6509 |
(:("substring-after" backwards) :)
|
|
6510 |
(:*******************************************************:)
|
|
6511 |
|
|
6512 |
count(fn:substring-after("substring-after","refta-gnirtsbus"))
|
|
6513 |
'.
|
|
6514 |
|
|
6515 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6516 |
|
|
6517 |
|
|
6518 |
result := interpreter evaluate: query.
|
|
6519 |
self
|
|
6520 |
assert: (self xqtsResultTextFromResult: result)
|
|
6521 |
= (self xqtsResultTextFromFile:
|
|
6522 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-21.txt')
|
|
6523 |
|
|
6524 |
"Created: / 11-05-2013 / 19:42:40 / jirka"
|
|
6525 |
!
|
|
6526 |
|
|
6527 |
test_fn_substring_after_3
|
|
6528 |
|
|
6529 |
| query result |
|
|
6530 |
|
|
6531 |
query := '
|
|
6532 |
(:*******************************************************:)
|
|
6533 |
(:Test: fn-substring-after-3 :)
|
|
6534 |
(:Written By: Carmelo Montanez :)
|
|
6535 |
(:Date: Fri May 27, 2005 :)
|
|
6536 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6537 |
(: with the arguments set as follows: :)
|
|
6538 |
(:$arg1 = "" :)
|
|
6539 |
(:$arg2 = "A Character String" :)
|
|
6540 |
(:*******************************************************:)
|
|
6541 |
|
|
6542 |
fn:count(fn:substring-after("A Character String",""))
|
|
6543 |
'.
|
|
6544 |
|
|
6545 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6546 |
|
|
6547 |
|
|
6548 |
result := interpreter evaluate: query.
|
|
6549 |
self
|
|
6550 |
assert: (self xqtsResultTextFromResult: result)
|
|
6551 |
= (self xqtsResultTextFromFile:
|
|
6552 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-3.txt')
|
|
6553 |
|
|
6554 |
"Created: / 11-05-2013 / 19:42:47 / jirka"
|
|
6555 |
!
|
|
6556 |
|
|
6557 |
test_fn_substring_after_4
|
|
6558 |
|
|
6559 |
| query result |
|
|
6560 |
|
|
6561 |
query := '
|
|
6562 |
(:*******************************************************:)
|
|
6563 |
(:Test: fn-substring-after-4 :)
|
|
6564 |
(:Written By: Carmelo Montanez :)
|
|
6565 |
(:Date: Fri May 27, 2005 :)
|
|
6566 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6567 |
(: with the arguments set as follows: :)
|
|
6568 |
(:$arg1 = () :)
|
|
6569 |
(:$arg2 = "" :)
|
|
6570 |
(:*******************************************************:)
|
|
6571 |
|
|
6572 |
fn:count(fn:substring-after((),""))
|
|
6573 |
'.
|
|
6574 |
|
|
6575 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6576 |
|
|
6577 |
|
|
6578 |
result := interpreter evaluate: query.
|
|
6579 |
self
|
|
6580 |
assert: (self xqtsResultTextFromResult: result)
|
|
6581 |
= (self xqtsResultTextFromFile:
|
|
6582 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-4.txt')
|
|
6583 |
|
|
6584 |
"Created: / 11-05-2013 / 19:42:55 / jirka"
|
|
6585 |
!
|
|
6586 |
|
|
6587 |
test_fn_substring_after_5
|
|
6588 |
|
|
6589 |
| query result |
|
|
6590 |
|
|
6591 |
query := '
|
|
6592 |
(:*******************************************************:)
|
|
6593 |
(:Test: fn-substring-after-5 :)
|
|
6594 |
(:Written By: Carmelo Montanez :)
|
|
6595 |
(:Date: Fri May 27, 2005 :)
|
|
6596 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6597 |
(: with the arguments set as follows: :)
|
|
6598 |
(:$arg1 = "" :)
|
|
6599 |
(:$arg2 = () :)
|
|
6600 |
(:*******************************************************:)
|
|
6601 |
|
|
6602 |
fn:count(fn:substring-after("",()))
|
|
6603 |
'.
|
|
6604 |
|
|
6605 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6606 |
|
|
6607 |
|
|
6608 |
result := interpreter evaluate: query.
|
|
6609 |
self
|
|
6610 |
assert: (self xqtsResultTextFromResult: result)
|
|
6611 |
= (self xqtsResultTextFromFile:
|
|
6612 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-5.txt')
|
|
6613 |
|
|
6614 |
"Created: / 11-05-2013 / 19:43:05 / jirka"
|
|
6615 |
!
|
|
6616 |
|
|
6617 |
test_fn_substring_after_6
|
|
6618 |
|
|
6619 |
| query result |
|
|
6620 |
|
|
6621 |
query := '
|
|
6622 |
(:*******************************************************:)
|
|
6623 |
(:Test: fn-substring-after-6 :)
|
|
6624 |
(:Written By: Carmelo Montanez :)
|
|
6625 |
(:Date: Fri May 27, 2005 :)
|
|
6626 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6627 |
(: with the arguments set as follows: :)
|
|
6628 |
(:$arg1 = "A Character String" :)
|
|
6629 |
(:$arg2 = () :)
|
|
6630 |
(:*******************************************************:)
|
|
6631 |
|
|
6632 |
fn:count(fn:substring-after("A Character String",()))
|
|
6633 |
'.
|
|
6634 |
|
|
6635 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6636 |
|
|
6637 |
|
|
6638 |
result := interpreter evaluate: query.
|
|
6639 |
self
|
|
6640 |
assert: (self xqtsResultTextFromResult: result)
|
|
6641 |
= (self xqtsResultTextFromFile:
|
|
6642 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-6.txt')
|
|
6643 |
|
|
6644 |
"Created: / 11-05-2013 / 19:43:14 / jirka"
|
|
6645 |
!
|
|
6646 |
|
|
6647 |
test_fn_substring_after_7
|
|
6648 |
|
|
6649 |
| query result |
|
|
6650 |
|
|
6651 |
query := '
|
|
6652 |
(:*******************************************************:)
|
|
6653 |
(:Test: fn-substring-after-7 :)
|
|
6654 |
(:Written By: Carmelo Montanez :)
|
|
6655 |
(:Date: Fri May 27, 2005 :)
|
|
6656 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6657 |
(: with the arguments set as follows: :)
|
|
6658 |
(:$arg1 = () :)
|
|
6659 |
(:$arg2 = "A Character String" :)
|
|
6660 |
(:*******************************************************:)
|
|
6661 |
|
|
6662 |
fn:count(fn:substring-after((),"A Character String"))
|
|
6663 |
'.
|
|
6664 |
|
|
6665 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6666 |
|
|
6667 |
|
|
6668 |
result := interpreter evaluate: query.
|
|
6669 |
self
|
|
6670 |
assert: (self xqtsResultTextFromResult: result)
|
|
6671 |
= (self xqtsResultTextFromFile:
|
|
6672 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-7.txt')
|
|
6673 |
|
|
6674 |
"Created: / 11-05-2013 / 19:43:22 / jirka"
|
|
6675 |
!
|
|
6676 |
|
|
6677 |
test_fn_substring_after_8
|
|
6678 |
|
|
6679 |
| query result |
|
|
6680 |
|
|
6681 |
query := '
|
|
6682 |
(:*******************************************************:)
|
|
6683 |
(:Test: fn-substring-after-8 :)
|
|
6684 |
(:Written By: Carmelo Montanez :)
|
|
6685 |
(:Date: Fri May 27, 2005 :)
|
|
6686 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6687 |
(: with the arguments set as follows: :)
|
|
6688 |
(:$arg1 = "AAAAABBBBBCCCCC" :)
|
|
6689 |
(:$arg2 = "BBBBB" :)
|
|
6690 |
(:*******************************************************:)
|
|
6691 |
|
|
6692 |
fn:substring-after("AAAAABBBBBCCCCC","BBBBB")
|
|
6693 |
'.
|
|
6694 |
|
|
6695 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6696 |
|
|
6697 |
|
|
6698 |
result := interpreter evaluate: query.
|
|
6699 |
self
|
|
6700 |
assert: (self xqtsResultTextFromResult: result)
|
|
6701 |
= (self xqtsResultTextFromFile:
|
|
6702 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-8.txt')
|
|
6703 |
|
|
6704 |
"Created: / 11-05-2013 / 19:43:31 / jirka"
|
|
6705 |
!
|
|
6706 |
|
|
6707 |
test_fn_substring_after_9
|
|
6708 |
|
|
6709 |
| query result |
|
|
6710 |
|
|
6711 |
query := '
|
|
6712 |
(:*******************************************************:)
|
|
6713 |
(:Test: fn-substring-after-9 :)
|
|
6714 |
(:Written By: Carmelo Montanez :)
|
|
6715 |
(:Date: Fri May 27, 2005 :)
|
|
6716 |
(:Purpose: Evaluates The "substring-after" function :)
|
|
6717 |
(: with the arguments set as follows: :)
|
|
6718 |
(:$arg1 = "AAAAABBBBB" :)
|
|
6719 |
(:$arg2 = " " :)
|
|
6720 |
(:*******************************************************:)
|
|
6721 |
|
|
6722 |
count(fn:substring-after("AAAAABBBBB"," "))
|
|
6723 |
'.
|
|
6724 |
|
|
6725 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6726 |
|
|
6727 |
|
|
6728 |
result := interpreter evaluate: query.
|
|
6729 |
self
|
|
6730 |
assert: (self xqtsResultTextFromResult: result)
|
|
6731 |
= (self xqtsResultTextFromFile:
|
|
6732 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringAfterFunc/fn-substring-after-9.txt')
|
|
6733 |
|
|
6734 |
"Created: / 11-05-2013 / 19:43:41 / jirka"
|
|
6735 |
!
|
|
6736 |
|
|
6737 |
test_fn_substring_before_1
|
|
6738 |
|
|
6739 |
| query result |
|
|
6740 |
|
|
6741 |
query := '
|
|
6742 |
(:*******************************************************:)
|
|
6743 |
(:Test: fn-substring-before-1 :)
|
|
6744 |
(:Written By: Carmelo Montanez :)
|
|
6745 |
(:Date: Fri May 27, 2005 :)
|
|
6746 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
6747 |
(: with the arguments set as follows: :)
|
|
6748 |
(:$arg1 = "" :)
|
|
6749 |
(:$arg2 = "" :)
|
|
6750 |
(:*******************************************************:)
|
|
6751 |
|
|
6752 |
fn:count(fn:substring-before("",""))
|
|
6753 |
'.
|
|
6754 |
|
|
6755 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6756 |
|
|
6757 |
|
|
6758 |
result := interpreter evaluate: query.
|
|
6759 |
self
|
|
6760 |
assert: (self xqtsResultTextFromResult: result)
|
|
6761 |
= (self xqtsResultTextFromFile:
|
|
6762 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-1.txt')
|
|
6763 |
|
|
6764 |
"Created: / 11-05-2013 / 19:43:51 / jirka"
|
|
6765 |
!
|
|
6766 |
|
|
6767 |
test_fn_substring_before_10
|
|
6768 |
|
|
6769 |
| query result |
|
|
6770 |
|
|
6771 |
query := '
|
|
6772 |
(:*******************************************************:)
|
|
6773 |
(:Test: fn-substring-before-10 :)
|
|
6774 |
(:Written By: Carmelo Montanez :)
|
|
6775 |
(:Date: Fri May 27, 2005 :)
|
|
6776 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
6777 |
(: with the arguments set as follows: :)
|
|
6778 |
(:$arg1 = " " :)
|
|
6779 |
(:$arg2 = " AAAAABBBBB" :)
|
|
6780 |
(:*******************************************************:)
|
|
6781 |
|
|
6782 |
fn:count(fn:substring-before(" ","AAAAABBBBB"))
|
|
6783 |
'.
|
|
6784 |
|
|
6785 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6786 |
|
|
6787 |
|
|
6788 |
result := interpreter evaluate: query.
|
|
6789 |
self
|
|
6790 |
assert: (self xqtsResultTextFromResult: result)
|
|
6791 |
= (self xqtsResultTextFromFile:
|
|
6792 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-10.txt')
|
|
6793 |
|
|
6794 |
"Created: / 11-05-2013 / 19:44:00 / jirka"
|
|
6795 |
!
|
|
6796 |
|
|
6797 |
test_fn_substring_before_11
|
|
6798 |
|
|
6799 |
| query result |
|
|
6800 |
|
|
6801 |
query := '
|
|
6802 |
(:*******************************************************:)
|
|
6803 |
(:Test: fn-substring-before-11 :)
|
|
6804 |
(:Written By: Carmelo Montanez :)
|
|
6805 |
(:Date: Fri May 27, 2005 :)
|
|
6806 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
6807 |
(:using it as a argument of a fn:not - returns true :)
|
|
6808 |
(:*******************************************************:)
|
|
6809 |
|
|
6810 |
fn:not(fn:substring-before("A","A"))
|
|
6811 |
'.
|
|
6812 |
|
|
6813 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6814 |
|
|
6815 |
|
|
6816 |
result := interpreter evaluate: query.
|
|
6817 |
self
|
|
6818 |
assert: (self xqtsResultTextFromResult: result)
|
|
6819 |
= (self xqtsResultTextFromFile:
|
|
6820 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-11.txt')
|
|
6821 |
|
|
6822 |
"Created: / 11-05-2013 / 19:44:09 / jirka"
|
|
6823 |
!
|
|
6824 |
|
|
6825 |
test_fn_substring_before_12
|
|
6826 |
|
|
6827 |
| query result |
|
|
6828 |
|
|
6829 |
query := '
|
|
6830 |
(:*******************************************************:)
|
|
6831 |
(:Test: fn-substring-before-12 :)
|
|
6832 |
(:Written By: Carmelo Montanez :)
|
|
6833 |
(:Date: Fri May 27, 2005 :)
|
|
6834 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
6835 |
(:using it as a argument of a fn:not - returns true :)
|
|
6836 |
(:*******************************************************:)
|
|
6837 |
|
|
6838 |
fn:not(fn:substring-before("A","B"))
|
|
6839 |
'.
|
|
6840 |
|
|
6841 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6842 |
|
|
6843 |
|
|
6844 |
result := interpreter evaluate: query.
|
|
6845 |
self
|
|
6846 |
assert: (self xqtsResultTextFromResult: result)
|
|
6847 |
= (self xqtsResultTextFromFile:
|
|
6848 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-12.txt')
|
|
6849 |
|
|
6850 |
"Created: / 11-05-2013 / 19:44:18 / jirka"
|
|
6851 |
!
|
|
6852 |
|
|
6853 |
test_fn_substring_before_13
|
|
6854 |
|
|
6855 |
| query result |
|
|
6856 |
|
|
6857 |
query := '
|
|
6858 |
(:*******************************************************:)
|
|
6859 |
(:Test: fn-substring-before-13 :)
|
|
6860 |
(:Written By: Carmelo Montanez :)
|
|
6861 |
(:Date: Fri May 27, 2005 :)
|
|
6862 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
6863 |
(: with the arguments set as follows: :)
|
|
6864 |
(:$arg1 = xs:string("A") :)
|
|
6865 |
(:$arg2 = "A" :)
|
|
6866 |
(:*******************************************************:)
|
|
6867 |
|
|
6868 |
fn:count(fn:substring-before(xs:string("A"),"A"))
|
|
6869 |
'.
|
|
6870 |
|
|
6871 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6872 |
|
|
6873 |
|
|
6874 |
result := interpreter evaluate: query.
|
|
6875 |
self
|
|
6876 |
assert: (self xqtsResultTextFromResult: result)
|
|
6877 |
= (self xqtsResultTextFromFile:
|
|
6878 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-13.txt')
|
|
6879 |
|
|
6880 |
"Created: / 11-05-2013 / 19:44:37 / jirka"
|
|
6881 |
!
|
|
6882 |
|
|
6883 |
test_fn_substring_before_14
|
|
6884 |
|
|
6885 |
| query result |
|
|
6886 |
|
|
6887 |
query := '
|
|
6888 |
(:*******************************************************:)
|
|
6889 |
(:Test: fn-substring-before-14 :)
|
|
6890 |
(:Written By: Carmelo Montanez :)
|
|
6891 |
(:Date: Fri May 27, 2005 :)
|
|
6892 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
6893 |
(: with the arguments set as follows: :)
|
|
6894 |
(:$arg1 = "A" :)
|
|
6895 |
(:$arg2 = xs:string("A") :)
|
|
6896 |
(:*******************************************************:)
|
|
6897 |
|
|
6898 |
fn:count(fn:substring-before("A",xs:string("A")))
|
|
6899 |
'.
|
|
6900 |
|
|
6901 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6902 |
|
|
6903 |
|
|
6904 |
result := interpreter evaluate: query.
|
|
6905 |
self
|
|
6906 |
assert: (self xqtsResultTextFromResult: result)
|
|
6907 |
= (self xqtsResultTextFromFile:
|
|
6908 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-14.txt')
|
|
6909 |
|
|
6910 |
"Created: / 11-05-2013 / 19:44:48 / jirka"
|
|
6911 |
!
|
|
6912 |
|
|
6913 |
test_fn_substring_before_15
|
|
6914 |
|
|
6915 |
| query result |
|
|
6916 |
|
|
6917 |
query := '
|
|
6918 |
(:*******************************************************:)
|
|
6919 |
(:Test: fn-substring-before-15 :)
|
|
6920 |
(:Written By: Carmelo Montanez :)
|
|
6921 |
(:Date: Fri May 27, 2005 :)
|
|
6922 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
6923 |
(: with the arguments set as follows: :)
|
|
6924 |
(:$arg1 = "A" :)
|
|
6925 |
(:$arg2 = "a" :)
|
|
6926 |
(:*******************************************************:)
|
|
6927 |
|
|
6928 |
fn:count(fn:substring-before("A","a"))
|
|
6929 |
'.
|
|
6930 |
|
|
6931 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6932 |
|
|
6933 |
|
|
6934 |
result := interpreter evaluate: query.
|
|
6935 |
self
|
|
6936 |
assert: (self xqtsResultTextFromResult: result)
|
|
6937 |
= (self xqtsResultTextFromFile:
|
|
6938 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-15.txt')
|
|
6939 |
|
|
6940 |
"Created: / 11-05-2013 / 19:44:56 / jirka"
|
|
6941 |
!
|
|
6942 |
|
|
6943 |
test_fn_substring_before_16
|
|
6944 |
|
|
6945 |
| query result |
|
|
6946 |
|
|
6947 |
query := '
|
|
6948 |
(:*******************************************************:)
|
|
6949 |
(:Test: fn-substring-before-16 :)
|
|
6950 |
(:Written By: Carmelo Montanez :)
|
|
6951 |
(:Date: Fri May 27, 2005 :)
|
|
6952 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
6953 |
(: with the arguments set as follows: :)
|
|
6954 |
(:$arg1 = "a" :)
|
|
6955 |
(:$arg2 = "A" :)
|
|
6956 |
(:*******************************************************:)
|
|
6957 |
|
|
6958 |
fn:count(fn:substring-before("a","A"))
|
|
6959 |
'.
|
|
6960 |
|
|
6961 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6962 |
|
|
6963 |
|
|
6964 |
result := interpreter evaluate: query.
|
|
6965 |
self
|
|
6966 |
assert: (self xqtsResultTextFromResult: result)
|
|
6967 |
= (self xqtsResultTextFromFile:
|
|
6968 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-16.txt')
|
|
6969 |
|
|
6970 |
"Created: / 11-05-2013 / 19:45:04 / jirka"
|
|
6971 |
!
|
|
6972 |
|
|
6973 |
test_fn_substring_before_17
|
|
6974 |
|
|
6975 |
| query result |
|
|
6976 |
|
|
6977 |
query := '
|
|
6978 |
(:*******************************************************:)
|
|
6979 |
(:Test: fn-substring-before-17 :)
|
|
6980 |
(:Written By: Carmelo Montanez :)
|
|
6981 |
(:Date: Mon Jun 1, 2005 :)
|
|
6982 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
6983 |
(: with the arguments set as follows: :)
|
|
6984 |
(:$arg1 = "substring-before" :)
|
|
6985 |
(:$arg2 = "substring-before" :)
|
|
6986 |
(:*******************************************************:)
|
|
6987 |
|
|
6988 |
fn:count(fn:substring-before("substring-before","substring-before"))
|
|
6989 |
'.
|
|
6990 |
|
|
6991 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
6992 |
|
|
6993 |
|
|
6994 |
result := interpreter evaluate: query.
|
|
6995 |
self
|
|
6996 |
assert: (self xqtsResultTextFromResult: result)
|
|
6997 |
= (self xqtsResultTextFromFile:
|
|
6998 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-17.txt')
|
|
6999 |
|
|
7000 |
"Created: / 11-05-2013 / 19:45:14 / jirka"
|
|
7001 |
!
|
|
7002 |
|
|
7003 |
test_fn_substring_before_18
|
|
7004 |
|
|
7005 |
| query result |
|
|
7006 |
|
|
7007 |
query := '
|
|
7008 |
(:*******************************************************:)
|
|
7009 |
(:Test: fn-substring-before-18 :)
|
|
7010 |
(:Written By: Carmelo Montanez :)
|
|
7011 |
(:Date: Mon Jun 1, 2005 :)
|
|
7012 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7013 |
(: with the arguments set as follows: :)
|
|
7014 |
(:$arg1 = "substring-beforesubstring-before" :)
|
|
7015 |
(:$arg2 = "substring-before" :)
|
|
7016 |
(:*******************************************************:)
|
|
7017 |
|
|
7018 |
fn:count(fn:substring-before("substring-beforesubstring-before","substring-before"))
|
|
7019 |
'.
|
|
7020 |
|
|
7021 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7022 |
|
|
7023 |
|
|
7024 |
result := interpreter evaluate: query.
|
|
7025 |
self
|
|
7026 |
assert: (self xqtsResultTextFromResult: result)
|
|
7027 |
= (self xqtsResultTextFromFile:
|
|
7028 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-18.txt')
|
|
7029 |
|
|
7030 |
"Created: / 11-05-2013 / 19:45:23 / jirka"
|
|
7031 |
!
|
|
7032 |
|
|
7033 |
test_fn_substring_before_19
|
|
7034 |
|
|
7035 |
| query result |
|
|
7036 |
|
|
7037 |
query := '
|
|
7038 |
(:*******************************************************:)
|
|
7039 |
(:Test: fn-substring-before-19 :)
|
|
7040 |
(:Written By: Carmelo Montanez :)
|
|
7041 |
(:Date: Mon Jun 1, 2005 :)
|
|
7042 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7043 |
(: with the arguments set as follows: :)
|
|
7044 |
(:$arg1 = "****" :)
|
|
7045 |
(:$arg2 = "***" :)
|
|
7046 |
(:*******************************************************:)
|
|
7047 |
|
|
7048 |
fn:count(fn:substring-before("****","***"))
|
|
7049 |
'.
|
|
7050 |
|
|
7051 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7052 |
|
|
7053 |
|
|
7054 |
result := interpreter evaluate: query.
|
|
7055 |
self
|
|
7056 |
assert: (self xqtsResultTextFromResult: result)
|
|
7057 |
= (self xqtsResultTextFromFile:
|
|
7058 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-19.txt')
|
|
7059 |
|
|
7060 |
"Created: / 11-05-2013 / 19:45:32 / jirka"
|
|
7061 |
!
|
|
7062 |
|
|
7063 |
test_fn_substring_before_2
|
|
7064 |
|
|
7065 |
| query result |
|
|
7066 |
|
|
7067 |
query := '
|
|
7068 |
(:*******************************************************:)
|
|
7069 |
(:Test: fn-substring-before-2 :)
|
|
7070 |
(:Written By: Carmelo Montanez :)
|
|
7071 |
(:Date: Fri May 27, 2005 :)
|
|
7072 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7073 |
(: with the arguments set as follows: :)
|
|
7074 |
(:$arg1 = "" :)
|
|
7075 |
(:$arg2 = "A Character String" :)
|
|
7076 |
(:*******************************************************:)
|
|
7077 |
|
|
7078 |
fn:count(fn:substring-before("","A Character String"))
|
|
7079 |
'.
|
|
7080 |
|
|
7081 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7082 |
|
|
7083 |
|
|
7084 |
result := interpreter evaluate: query.
|
|
7085 |
self
|
|
7086 |
assert: (self xqtsResultTextFromResult: result)
|
|
7087 |
= (self xqtsResultTextFromFile:
|
|
7088 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-2.txt')
|
|
7089 |
|
|
7090 |
"Created: / 11-05-2013 / 19:45:57 / jirka"
|
|
7091 |
!
|
|
7092 |
|
|
7093 |
test_fn_substring_before_20
|
|
7094 |
|
|
7095 |
| query result |
|
|
7096 |
|
|
7097 |
query := '
|
|
7098 |
(:*******************************************************:)
|
|
7099 |
(:Test: fn-substring-before-20 :)
|
|
7100 |
(:Written By: Carmelo Montanez :)
|
|
7101 |
(:Date: Mon Jun 1, 2005 :)
|
|
7102 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7103 |
(: with the arguments set as follows: :)
|
|
7104 |
(:$arg1 = "12345" :)
|
|
7105 |
(:$arg2 = "2345" :)
|
|
7106 |
(:*******************************************************:)
|
|
7107 |
|
|
7108 |
fn:substring-before("12345","2345")
|
|
7109 |
'.
|
|
7110 |
|
|
7111 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7112 |
|
|
7113 |
|
|
7114 |
result := interpreter evaluate: query.
|
|
7115 |
self
|
|
7116 |
assert: (self xqtsResultTextFromResult: result)
|
|
7117 |
= (self xqtsResultTextFromFile:
|
|
7118 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-20.txt')
|
|
7119 |
|
|
7120 |
"Created: / 11-05-2013 / 19:46:06 / jirka"
|
|
7121 |
!
|
|
7122 |
|
|
7123 |
test_fn_substring_before_21
|
|
7124 |
|
|
7125 |
| query result |
|
|
7126 |
|
|
7127 |
query := '
|
|
7128 |
(:*******************************************************:)
|
|
7129 |
(:Test: fn-substring-before-21 :)
|
|
7130 |
(:Written By: Carmelo Montanez :)
|
|
7131 |
(:Date: Mon Jun 1, 2005 :)
|
|
7132 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7133 |
(: with the arguments set as follows: :)
|
|
7134 |
(:$arg1 = "substring-before :)
|
|
7135 |
(:$arg2 = "erofeb-gnirtsbus :)
|
|
7136 |
(:("substring-before" backwards) :)
|
|
7137 |
(:*******************************************************:)
|
|
7138 |
|
|
7139 |
count(fn:substring-before("substring-before","erofeb-gnirtsbus"))
|
|
7140 |
'.
|
|
7141 |
|
|
7142 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7143 |
|
|
7144 |
|
|
7145 |
result := interpreter evaluate: query.
|
|
7146 |
self
|
|
7147 |
assert: (self xqtsResultTextFromResult: result)
|
|
7148 |
= (self xqtsResultTextFromFile:
|
|
7149 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-21.txt')
|
|
7150 |
|
|
7151 |
"Created: / 11-05-2013 / 19:46:34 / jirka"
|
|
7152 |
!
|
|
7153 |
|
|
7154 |
test_fn_substring_before_3
|
|
7155 |
|
|
7156 |
| query result |
|
|
7157 |
|
|
7158 |
query := '
|
|
7159 |
(:*******************************************************:)
|
|
7160 |
(:Test: fn-substring-before-3 :)
|
|
7161 |
(:Written By: Carmelo Montanez :)
|
|
7162 |
(:Date: Fri May 27, 2005 :)
|
|
7163 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7164 |
(: with the arguments set as follows: :)
|
|
7165 |
(:$arg1 = "" :)
|
|
7166 |
(:$arg2 = "A Character String" :)
|
|
7167 |
(:*******************************************************:)
|
|
7168 |
|
|
7169 |
fn:count(fn:substring-before("A Character String",""))
|
|
7170 |
'.
|
|
7171 |
|
|
7172 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7173 |
|
|
7174 |
|
|
7175 |
result := interpreter evaluate: query.
|
|
7176 |
self
|
|
7177 |
assert: (self xqtsResultTextFromResult: result)
|
|
7178 |
= (self xqtsResultTextFromFile:
|
|
7179 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-3.txt')
|
|
7180 |
|
|
7181 |
"Created: / 11-05-2013 / 19:46:44 / jirka"
|
|
7182 |
!
|
|
7183 |
|
|
7184 |
test_fn_substring_before_4
|
|
7185 |
|
|
7186 |
| query result |
|
|
7187 |
|
|
7188 |
query := '
|
|
7189 |
(:*******************************************************:)
|
|
7190 |
(:Test: fn-substring-before-4 :)
|
|
7191 |
(:Written By: Carmelo Montanez :)
|
|
7192 |
(:Date: Fri May 27, 2005 :)
|
|
7193 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7194 |
(: with the arguments set as follows: :)
|
|
7195 |
(:$arg1 = () :)
|
|
7196 |
(:$arg2 = "" :)
|
|
7197 |
(:*******************************************************:)
|
|
7198 |
|
|
7199 |
fn:count(fn:substring-before((),""))
|
|
7200 |
'.
|
|
7201 |
|
|
7202 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7203 |
|
|
7204 |
|
|
7205 |
result := interpreter evaluate: query.
|
|
7206 |
self
|
|
7207 |
assert: (self xqtsResultTextFromResult: result)
|
|
7208 |
= (self xqtsResultTextFromFile:
|
|
7209 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-4.txt')
|
|
7210 |
|
|
7211 |
"Created: / 11-05-2013 / 19:46:53 / jirka"
|
|
7212 |
!
|
|
7213 |
|
|
7214 |
test_fn_substring_before_5
|
|
7215 |
|
|
7216 |
| query result |
|
|
7217 |
|
|
7218 |
query := '
|
|
7219 |
(:*******************************************************:)
|
|
7220 |
(:Test: fn-substring-before-5 :)
|
|
7221 |
(:Written By: Carmelo Montanez :)
|
|
7222 |
(:Date: Fri May 27, 2005 :)
|
|
7223 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7224 |
(: with the arguments set as follows: :)
|
|
7225 |
(:$arg1 = "" :)
|
|
7226 |
(:$arg2 = () :)
|
|
7227 |
(:*******************************************************:)
|
|
7228 |
|
|
7229 |
fn:count(fn:substring-before("",()))
|
|
7230 |
'.
|
|
7231 |
|
|
7232 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7233 |
|
|
7234 |
|
|
7235 |
result := interpreter evaluate: query.
|
|
7236 |
self
|
|
7237 |
assert: (self xqtsResultTextFromResult: result)
|
|
7238 |
= (self xqtsResultTextFromFile:
|
|
7239 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-5.txt')
|
|
7240 |
|
|
7241 |
"Created: / 11-05-2013 / 19:47:02 / jirka"
|
|
7242 |
!
|
|
7243 |
|
|
7244 |
test_fn_substring_before_6
|
|
7245 |
|
|
7246 |
| query result |
|
|
7247 |
|
|
7248 |
query := '
|
|
7249 |
(:*******************************************************:)
|
|
7250 |
(:Test: fn-substring-before-6 :)
|
|
7251 |
(:Written By: Carmelo Montanez :)
|
|
7252 |
(:Date: Fri May 27, 2005 :)
|
|
7253 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7254 |
(: with the arguments set as follows: :)
|
|
7255 |
(:$arg1 = "A Character String" :)
|
|
7256 |
(:$arg2 = () :)
|
|
7257 |
(:*******************************************************:)
|
|
7258 |
|
|
7259 |
fn:count(fn:substring-before("A Character String",()))
|
|
7260 |
'.
|
|
7261 |
|
|
7262 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7263 |
|
|
7264 |
|
|
7265 |
result := interpreter evaluate: query.
|
|
7266 |
self
|
|
7267 |
assert: (self xqtsResultTextFromResult: result)
|
|
7268 |
= (self xqtsResultTextFromFile:
|
|
7269 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-6.txt')
|
|
7270 |
|
|
7271 |
"Created: / 11-05-2013 / 19:47:12 / jirka"
|
|
7272 |
!
|
|
7273 |
|
|
7274 |
test_fn_substring_before_7
|
|
7275 |
|
|
7276 |
| query result |
|
|
7277 |
|
|
7278 |
query := '
|
|
7279 |
(:*******************************************************:)
|
|
7280 |
(:Test: fn-substring-before-7 :)
|
|
7281 |
(:Written By: Carmelo Montanez :)
|
|
7282 |
(:Date: Fri May 27, 2005 :)
|
|
7283 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7284 |
(: with the arguments set as follows: :)
|
|
7285 |
(:$arg1 = () :)
|
|
7286 |
(:$arg2 = "A Character String" :)
|
|
7287 |
(:*******************************************************:)
|
|
7288 |
|
|
7289 |
fn:count(fn:substring-before((),"A Character String"))
|
|
7290 |
'.
|
|
7291 |
|
|
7292 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7293 |
|
|
7294 |
|
|
7295 |
result := interpreter evaluate: query.
|
|
7296 |
self
|
|
7297 |
assert: (self xqtsResultTextFromResult: result)
|
|
7298 |
= (self xqtsResultTextFromFile:
|
|
7299 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-7.txt')
|
|
7300 |
|
|
7301 |
"Created: / 11-05-2013 / 19:47:20 / jirka"
|
|
7302 |
!
|
|
7303 |
|
|
7304 |
test_fn_substring_before_8
|
|
7305 |
|
|
7306 |
| query result |
|
|
7307 |
|
|
7308 |
query := '
|
|
7309 |
(:*******************************************************:)
|
|
7310 |
(:Test: fn-substring-before-8 :)
|
|
7311 |
(:Written By: Carmelo Montanez :)
|
|
7312 |
(:Date: Fri May 27, 2005 :)
|
|
7313 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7314 |
(: with the arguments set as follows: :)
|
|
7315 |
(:$arg1 = "AAAAABBBBBCCCCC" :)
|
|
7316 |
(:$arg2 = "BBBBB" :)
|
|
7317 |
(:*******************************************************:)
|
|
7318 |
|
|
7319 |
fn:substring-before("AAAAABBBBBCCCCC","BBBBB")
|
|
7320 |
'.
|
|
7321 |
|
|
7322 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7323 |
|
|
7324 |
|
|
7325 |
result := interpreter evaluate: query.
|
|
7326 |
self
|
|
7327 |
assert: (self xqtsResultTextFromResult: result)
|
|
7328 |
= (self xqtsResultTextFromFile:
|
|
7329 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-8.txt')
|
|
7330 |
|
|
7331 |
"Created: / 11-05-2013 / 19:47:29 / jirka"
|
|
7332 |
!
|
|
7333 |
|
|
7334 |
test_fn_substring_before_9
|
|
7335 |
|
|
7336 |
| query result |
|
|
7337 |
|
|
7338 |
query := '
|
|
7339 |
(:*******************************************************:)
|
|
7340 |
(:Test: fn-substring-before-9 :)
|
|
7341 |
(:Written By: Carmelo Montanez :)
|
|
7342 |
(:Date: Fri May 27, 2005 :)
|
|
7343 |
(:Purpose: Evaluates The "substring-before" function :)
|
|
7344 |
(: with the arguments set as follows: :)
|
|
7345 |
(:$arg1 = "AAAAABBBBB" :)
|
|
7346 |
(:$arg2 = " " :)
|
|
7347 |
(:*******************************************************:)
|
|
7348 |
|
|
7349 |
count(fn:substring-before("AAAAABBBBB"," "))
|
|
7350 |
'.
|
|
7351 |
|
|
7352 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7353 |
|
|
7354 |
|
|
7355 |
result := interpreter evaluate: query.
|
|
7356 |
self
|
|
7357 |
assert: (self xqtsResultTextFromResult: result)
|
|
7358 |
= (self xqtsResultTextFromFile:
|
|
7359 |
'Functions/AllStringFunc/SubstringStringFunc/SubstringBeforeFunc/fn-substring-before-9.txt')
|
|
7360 |
|
|
7361 |
"Created: / 11-05-2013 / 19:47:38 / jirka"
|
|
7362 |
!
|
|
7363 |
|
|
7364 |
test_fn_translate_1
|
|
7365 |
|
|
7366 |
| query result |
|
|
7367 |
|
|
7368 |
query := '
|
|
7369 |
(: Name: fn-translate-1 :)
|
|
7370 |
(: Description: Simple test of translate function as per example one for this function from the F andO specs.:)
|
|
7371 |
|
|
7372 |
fn:translate("bar","abc","ABC")
|
|
7373 |
'.
|
|
7374 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7375 |
|
|
7376 |
|
|
7377 |
result := interpreter evaluate: query.
|
|
7378 |
self
|
|
7379 |
assert: (self xqtsResultTextFromResult: result)
|
|
7380 |
= (self xqtsResultTextFromFile:
|
|
7381 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-1.txt')
|
|
7382 |
|
|
7383 |
"Created: / 13-05-2013 / 13:44:54 / houzvjir@fel.cvut.cz"
|
|
7384 |
!
|
|
7385 |
|
|
7386 |
test_fn_translate_10
|
|
7387 |
|
|
7388 |
| query result |
|
|
7389 |
|
|
7390 |
query := '
|
|
7391 |
(: Name: fn-translate-11 :)
|
|
7392 |
(: Description: Evaluation of translate function as an argument to the "fn:string" function.:)
|
|
7393 |
|
|
7394 |
fn:string(fn:translate("ABC", "ABC", "ABC"))
|
|
7395 |
'.
|
|
7396 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7397 |
|
|
7398 |
|
|
7399 |
result := interpreter evaluate: query.
|
|
7400 |
self
|
|
7401 |
assert: (self xqtsResultTextFromResult: result)
|
|
7402 |
= (self xqtsResultTextFromFile:
|
|
7403 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-10.txt')
|
|
7404 |
|
|
7405 |
"Created: / 13-05-2013 / 13:49:39 / houzvjir@fel.cvut.cz"
|
|
7406 |
!
|
|
7407 |
|
|
7408 |
test_fn_translate_11
|
|
7409 |
|
|
7410 |
| query result |
|
|
7411 |
|
|
7412 |
query := '
|
|
7413 |
(: Name: fn-translate-11 :)
|
|
7414 |
(: Description: Evaluation of translate function as an argument to the "fn:string" function.:)
|
|
7415 |
|
|
7416 |
fn:string(fn:translate("ABC", "ABC", "ABC"))
|
|
7417 |
'.
|
|
7418 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7419 |
|
|
7420 |
|
|
7421 |
result := interpreter evaluate: query.
|
|
7422 |
self
|
|
7423 |
assert: (self xqtsResultTextFromResult: result)
|
|
7424 |
= (self xqtsResultTextFromFile:
|
|
7425 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-11.txt')
|
|
7426 |
|
|
7427 |
"Created: / 13-05-2013 / 13:50:24 / houzvjir@fel.cvut.cz"
|
|
7428 |
!
|
|
7429 |
|
|
7430 |
test_fn_translate_12
|
|
7431 |
|
|
7432 |
| query result |
|
|
7433 |
|
|
7434 |
query := '
|
|
7435 |
(: Name: fn-translate-12 :)
|
|
7436 |
(: Description: Evaluation of translate function as an argument to the "fn:string-length" function.:)
|
|
7437 |
|
|
7438 |
fn:string-length(fn:translate("ABC","ABC","ABC"))
|
|
7439 |
'.
|
|
7440 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7441 |
|
|
7442 |
|
|
7443 |
result := interpreter evaluate: query.
|
|
7444 |
self
|
|
7445 |
assert: (self xqtsResultTextFromResult: result)
|
|
7446 |
= (self xqtsResultTextFromFile:
|
|
7447 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-12.txt')
|
|
7448 |
|
|
7449 |
"Created: / 13-05-2013 / 13:50:45 / houzvjir@fel.cvut.cz"
|
|
7450 |
!
|
|
7451 |
|
|
7452 |
test_fn_translate_13
|
|
7453 |
|
|
7454 |
| query result |
|
|
7455 |
|
|
7456 |
query := '
|
|
7457 |
(: Name: fn-translate-13 :)
|
|
7458 |
(: Description: Evaluation of translate function as an argument to the "xs:decimal" constructor function.:)
|
|
7459 |
|
|
7460 |
xs:decimal(fn:translate("123","123","123"))
|
|
7461 |
'.
|
|
7462 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7463 |
|
|
7464 |
|
|
7465 |
result := interpreter evaluate: query.
|
|
7466 |
self
|
|
7467 |
assert: (self xqtsResultTextFromResult: result)
|
|
7468 |
= (self xqtsResultTextFromFile:
|
|
7469 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-13.txt')
|
|
7470 |
|
|
7471 |
"Created: / 13-05-2013 / 13:51:12 / houzvjir@fel.cvut.cz"
|
|
7472 |
!
|
|
7473 |
|
|
7474 |
test_fn_translate_14
|
|
7475 |
|
|
7476 |
| query result |
|
|
7477 |
|
|
7478 |
query := '
|
|
7479 |
(: Name: fn-translate-14 :)
|
|
7480 |
(: Description: Evaluation of translate function as an argument to the "xs:integer" constructor function.:)
|
|
7481 |
|
|
7482 |
xs:integer(fn:translate("123","123","123"))
|
|
7483 |
'.
|
|
7484 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7485 |
|
|
7486 |
|
|
7487 |
result := interpreter evaluate: query.
|
|
7488 |
self
|
|
7489 |
assert: (self xqtsResultTextFromResult: result)
|
|
7490 |
= (self xqtsResultTextFromFile:
|
|
7491 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-14.txt')
|
|
7492 |
|
|
7493 |
"Created: / 13-05-2013 / 13:51:41 / houzvjir@fel.cvut.cz"
|
|
7494 |
!
|
|
7495 |
|
|
7496 |
test_fn_translate_15
|
|
7497 |
|
|
7498 |
| query result |
|
|
7499 |
|
|
7500 |
query := '
|
|
7501 |
(: Name: fn-translate-15 :)
|
|
7502 |
(: Description: Evaluation of translate function as an argument to the "xs:float" constructor function.:)
|
|
7503 |
|
|
7504 |
xs:float(fn:translate("123","123","123"))
|
|
7505 |
'.
|
|
7506 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7507 |
|
|
7508 |
|
|
7509 |
result := interpreter evaluate: query.
|
|
7510 |
self
|
|
7511 |
assert: (self xqtsResultTextFromResult: result)
|
|
7512 |
= (self xqtsResultTextFromFile:
|
|
7513 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-15.txt')
|
|
7514 |
|
|
7515 |
"Created: / 13-05-2013 / 13:52:01 / houzvjir@fel.cvut.cz"
|
|
7516 |
!
|
|
7517 |
|
|
7518 |
test_fn_translate_16
|
|
7519 |
|
|
7520 |
| query result |
|
|
7521 |
|
|
7522 |
query := '
|
|
7523 |
(: Name: fn-translate-16 :)
|
|
7524 |
(: Description: Evaluation of translate function as an argument to the "xs:double" constructor function.:)
|
|
7525 |
|
|
7526 |
xs:double(fn:translate("123","123","123"))
|
|
7527 |
'.
|
|
7528 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7529 |
|
|
7530 |
|
|
7531 |
result := interpreter evaluate: query.
|
|
7532 |
self
|
|
7533 |
assert: (self xqtsResultTextFromResult: result)
|
|
7534 |
= (self xqtsResultTextFromFile:
|
|
7535 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-16.txt')
|
|
7536 |
|
|
7537 |
"Created: / 13-05-2013 / 13:52:17 / houzvjir@fel.cvut.cz"
|
|
7538 |
!
|
|
7539 |
|
|
7540 |
test_fn_translate_2
|
|
7541 |
|
|
7542 |
| query result |
|
|
7543 |
|
|
7544 |
query := '
|
|
7545 |
(: Name: fn-translate-2 :)
|
|
7546 |
(: Description: Simple test of translate function as per example two for this function from the F andO specs.:)
|
|
7547 |
|
|
7548 |
fn:translate("--aaa--","abc-","ABC")
|
|
7549 |
'.
|
|
7550 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7551 |
|
|
7552 |
|
|
7553 |
result := interpreter evaluate: query.
|
|
7554 |
self
|
|
7555 |
assert: (self xqtsResultTextFromResult: result)
|
|
7556 |
= (self xqtsResultTextFromFile:
|
|
7557 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-2.txt')
|
|
7558 |
|
|
7559 |
"Created: / 13-05-2013 / 13:45:24 / houzvjir@fel.cvut.cz"
|
|
7560 |
!
|
|
7561 |
|
|
7562 |
test_fn_translate_3
|
|
7563 |
|
|
7564 |
| query result |
|
|
7565 |
|
|
7566 |
query := '
|
|
7567 |
(: Name: fn-translate-3 :)
|
|
7568 |
(: Description: Simple test of translate function as per example three for this function from the F andO specs.:)
|
|
7569 |
|
|
7570 |
fn:translate("abcdabc", "abc", "AB")
|
|
7571 |
'.
|
|
7572 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7573 |
|
|
7574 |
|
|
7575 |
result := interpreter evaluate: query.
|
|
7576 |
self
|
|
7577 |
assert: (self xqtsResultTextFromResult: result)
|
|
7578 |
= (self xqtsResultTextFromFile:
|
|
7579 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-3.txt')
|
|
7580 |
|
|
7581 |
"Created: / 13-05-2013 / 13:46:03 / houzvjir@fel.cvut.cz"
|
|
7582 |
!
|
|
7583 |
|
|
7584 |
test_fn_translate_4
|
|
7585 |
|
|
7586 |
| query result |
|
|
7587 |
|
|
7588 |
query := '
|
|
7589 |
(: Name: fn-translate-4 :)
|
|
7590 |
(: Description: Evaluation of translate function. Translate lower case letters to upper case letters.:)
|
|
7591 |
|
|
7592 |
fn:translate("acdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
|
7593 |
'.
|
|
7594 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7595 |
|
|
7596 |
|
|
7597 |
result := interpreter evaluate: query.
|
|
7598 |
self
|
|
7599 |
assert: (self xqtsResultTextFromResult: result)
|
|
7600 |
= (self xqtsResultTextFromFile:
|
|
7601 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-4.txt')
|
|
7602 |
|
|
7603 |
"Created: / 13-05-2013 / 13:46:22 / houzvjir@fel.cvut.cz"
|
|
7604 |
!
|
|
7605 |
|
|
7606 |
test_fn_translate_5
|
|
7607 |
|
|
7608 |
| query result |
|
|
7609 |
|
|
7610 |
query := '
|
|
7611 |
(: Name: fn-translate-5 :)
|
|
7612 |
(: Description: Evaluation of translate function. Translate upper case letters to lower case letters.:)
|
|
7613 |
|
|
7614 |
fn:translate("ABCDEFGHIJKLMNOPQRSTUVWXYZ","ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")
|
|
7615 |
'.
|
|
7616 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7617 |
|
|
7618 |
|
|
7619 |
result := interpreter evaluate: query.
|
|
7620 |
self
|
|
7621 |
assert: (self xqtsResultTextFromResult: result)
|
|
7622 |
= (self xqtsResultTextFromFile:
|
|
7623 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-5.txt')
|
|
7624 |
|
|
7625 |
"Created: / 13-05-2013 / 13:47:02 / houzvjir@fel.cvut.cz"
|
|
7626 |
!
|
|
7627 |
|
|
7628 |
test_fn_translate_6
|
|
7629 |
|
|
7630 |
| query result |
|
|
7631 |
|
|
7632 |
query := '
|
|
7633 |
(: Name: fn-translate-6 :)
|
|
7634 |
(: Description: Evaluation of translate function, where all three arguments are the zero length string.:)
|
|
7635 |
(: Use fn;count to avoid empty file. :)
|
|
7636 |
|
|
7637 |
fn:count(fn:translate("","",""))
|
|
7638 |
'.
|
|
7639 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7640 |
|
|
7641 |
|
|
7642 |
result := interpreter evaluate: query.
|
|
7643 |
self
|
|
7644 |
assert: (self xqtsResultTextFromResult: result)
|
|
7645 |
= (self xqtsResultTextFromFile:
|
|
7646 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-6.txt')
|
|
7647 |
|
|
7648 |
"Created: / 13-05-2013 / 13:47:22 / houzvjir@fel.cvut.cz"
|
|
7649 |
!
|
|
7650 |
|
|
7651 |
test_fn_translate_7
|
|
7652 |
|
|
7653 |
| query result |
|
|
7654 |
|
|
7655 |
query := '
|
|
7656 |
(: Name: fn-translate-7 :)
|
|
7657 |
(: Description: Evaluation of translate function, where the first and third arguments are the same (letters).:)
|
|
7658 |
|
|
7659 |
fn:translate("ABC", "ABC", "ABC")
|
|
7660 |
'.
|
|
7661 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7662 |
|
|
7663 |
|
|
7664 |
result := interpreter evaluate: query.
|
|
7665 |
self
|
|
7666 |
assert: (self xqtsResultTextFromResult: result)
|
|
7667 |
= (self xqtsResultTextFromFile:
|
|
7668 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-7.txt')
|
|
7669 |
|
|
7670 |
"Created: / 13-05-2013 / 13:48:03 / houzvjir@fel.cvut.cz"
|
|
7671 |
!
|
|
7672 |
|
|
7673 |
test_fn_translate_8
|
|
7674 |
|
|
7675 |
| query result |
|
|
7676 |
|
|
7677 |
query := '
|
|
7678 |
(: Name: fn-translate-8 :)
|
|
7679 |
(: Description: Evaluation of translate function, where all arguments are the same (numbers).:)
|
|
7680 |
|
|
7681 |
fn:translate("123", "123", "123")
|
|
7682 |
'.
|
|
7683 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7684 |
|
|
7685 |
|
|
7686 |
result := interpreter evaluate: query.
|
|
7687 |
self
|
|
7688 |
assert: (self xqtsResultTextFromResult: result)
|
|
7689 |
= (self xqtsResultTextFromFile:
|
|
7690 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-8.txt')
|
|
7691 |
|
|
7692 |
"Created: / 13-05-2013 / 13:48:55 / houzvjir@fel.cvut.cz"
|
|
7693 |
!
|
|
7694 |
|
|
7695 |
test_fn_translate_9
|
|
7696 |
|
|
7697 |
| query result |
|
|
7698 |
|
|
7699 |
query := '
|
|
7700 |
(: Name: fn-translate-9 :)
|
|
7701 |
(: Description: Evaluation of translate function, there is a mixture of numbers and letters.:)
|
|
7702 |
|
|
7703 |
fn:translate("123ABC", "123ABC", "123ABC")
|
|
7704 |
'.
|
|
7705 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7706 |
|
|
7707 |
|
|
7708 |
result := interpreter evaluate: query.
|
|
7709 |
self
|
|
7710 |
assert: (self xqtsResultTextFromResult: result)
|
|
7711 |
= (self xqtsResultTextFromFile:
|
|
7712 |
'Functions/AllStringFunc/GeneralStringFunc/TranslateFunc/fn-translate-9.txt')
|
|
7713 |
|
|
7714 |
"Created: / 13-05-2013 / 13:49:17 / houzvjir@fel.cvut.cz"
|
|
7715 |
!
|
|
7716 |
|
|
7717 |
test_fn_upper_case1args_1
|
|
7718 |
|
|
7719 |
| query result |
|
|
7720 |
|
|
7721 |
query := '
|
|
7722 |
(:*******************************************************:)
|
|
7723 |
(:Test: upper-case1args-1 :)
|
|
7724 |
(:Written By: Carmelo Montanez :)
|
|
7725 |
(:Date: Fri Dec 10 10:15:47 GMT-05:00 2004 :)
|
|
7726 |
(:Purpose: Evaluates The "upper-case" function :)
|
|
7727 |
(: with the arguments set as follows: :)
|
|
7728 |
(:$arg = xs:string(lower bound) :)
|
|
7729 |
(:*******************************************************:)
|
|
7730 |
|
|
7731 |
fn:upper-case(xs:string("This is a characte"))
|
|
7732 |
'.
|
|
7733 |
|
|
7734 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7735 |
|
|
7736 |
|
|
7737 |
result := interpreter evaluate: query.
|
|
7738 |
self
|
|
7739 |
assert: (self xqtsResultTextFromResult: result)
|
|
7740 |
= (self xqtsResultTextFromFile:
|
|
7741 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case1args-1.txt')
|
|
7742 |
|
|
7743 |
"Created: / 11-05-2013 / 22:05:38 / houzvjir@fel.cvut.cz"
|
|
7744 |
!
|
|
7745 |
|
|
7746 |
test_fn_upper_case1args_2
|
|
7747 |
|
|
7748 |
| query result |
|
|
7749 |
|
|
7750 |
query := '
|
|
7751 |
(:*******************************************************:)
|
|
7752 |
(:Test: upper-case1args-2 :)
|
|
7753 |
(:Written By: Carmelo Montanez :)
|
|
7754 |
(:Date: Fri Dec 10 10:15:47 GMT-05:00 2004 :)
|
|
7755 |
(:Purpose: Evaluates The "upper-case" function :)
|
|
7756 |
(: with the arguments set as follows: :)
|
|
7757 |
(:$arg = xs:string(mid range) :)
|
|
7758 |
(:*******************************************************:)
|
|
7759 |
|
|
7760 |
fn:upper-case(xs:string("This is a characte"))
|
|
7761 |
'.
|
|
7762 |
|
|
7763 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7764 |
|
|
7765 |
|
|
7766 |
result := interpreter evaluate: query.
|
|
7767 |
self
|
|
7768 |
assert: (self xqtsResultTextFromResult: result)
|
|
7769 |
= (self xqtsResultTextFromFile:
|
|
7770 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case1args-2.txt')
|
|
7771 |
|
|
7772 |
"Created: / 11-05-2013 / 22:04:23 / houzvjir@fel.cvut.cz"
|
|
7773 |
!
|
|
7774 |
|
|
7775 |
test_fn_upper_case1args_3
|
|
7776 |
|
|
7777 |
| query result |
|
|
7778 |
|
|
7779 |
query := '
|
|
7780 |
(:*******************************************************:)
|
|
7781 |
(:Test: upper-case1args-3 :)
|
|
7782 |
(:Written By: Carmelo Montanez :)
|
|
7783 |
(:Date: Fri Dec 10 10:15:47 GMT-05:00 2004 :)
|
|
7784 |
(:Purpose: Evaluates The "upper-case" function :)
|
|
7785 |
(: with the arguments set as follows: :)
|
|
7786 |
(:$arg = xs:string(upper bound) :)
|
|
7787 |
(:*******************************************************:)
|
|
7788 |
|
|
7789 |
fn:upper-case(xs:string("This is a characte"))
|
|
7790 |
'.
|
|
7791 |
|
|
7792 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7793 |
|
|
7794 |
|
|
7795 |
result := interpreter evaluate: query.
|
|
7796 |
self
|
|
7797 |
assert: (self xqtsResultTextFromResult: result)
|
|
7798 |
= (self xqtsResultTextFromFile:
|
|
7799 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case1args-3.txt')
|
|
7800 |
|
|
7801 |
"Created: / 11-05-2013 / 22:07:17 / houzvjir@fel.cvut.cz"
|
|
7802 |
!
|
|
7803 |
|
|
7804 |
test_fn_upper_case_1
|
|
7805 |
|
|
7806 |
| query result |
|
|
7807 |
|
|
7808 |
query := '
|
|
7809 |
(: Name: fn-upper-case-1 :)
|
|
7810 |
(: Description: Evaluation of upper-case function as per example 1 (for this function) :)
|
|
7811 |
(: from the F&O specs. :)
|
|
7812 |
|
|
7813 |
fn:upper-case("ABc!!D")
|
|
7814 |
'.
|
|
7815 |
|
|
7816 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7817 |
|
|
7818 |
|
|
7819 |
result := interpreter evaluate: query.
|
|
7820 |
self
|
|
7821 |
assert: (self xqtsResultTextFromResult: result)
|
|
7822 |
= (self xqtsResultTextFromFile:
|
|
7823 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-1.txt')
|
|
7824 |
|
|
7825 |
"Created: / 11-05-2013 / 19:47:46 / jirka"
|
|
7826 |
!
|
|
7827 |
|
|
7828 |
test_fn_upper_case_10
|
|
7829 |
|
|
7830 |
| query result |
|
|
7831 |
|
|
7832 |
query := '
|
|
7833 |
(: Name: fn-upper-case-10 :)
|
|
7834 |
(: Description: Evaluation of upper-case function with argument set to "*****":)
|
|
7835 |
|
|
7836 |
fn:upper-case("*****")
|
|
7837 |
'.
|
|
7838 |
|
|
7839 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7840 |
|
|
7841 |
|
|
7842 |
result := interpreter evaluate: query.
|
|
7843 |
self
|
|
7844 |
assert: (self xqtsResultTextFromResult: result)
|
|
7845 |
= (self xqtsResultTextFromFile:
|
|
7846 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-10.txt')
|
|
7847 |
|
|
7848 |
"Created: / 11-05-2013 / 19:47:54 / jirka"
|
|
7849 |
!
|
|
7850 |
|
|
7851 |
test_fn_upper_case_11
|
|
7852 |
|
|
7853 |
| query result |
|
|
7854 |
|
|
7855 |
query := '
|
|
7856 |
(: Name: fn-upper-case-11 :)
|
|
7857 |
(: Description: Evaluation of upper-case function with argument set to another upper case function:)
|
|
7858 |
|
|
7859 |
fn:upper-case(upper-case("zzzzz"))
|
|
7860 |
'.
|
|
7861 |
|
|
7862 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7863 |
|
|
7864 |
|
|
7865 |
result := interpreter evaluate: query.
|
|
7866 |
self
|
|
7867 |
assert: (self xqtsResultTextFromResult: result)
|
|
7868 |
= (self xqtsResultTextFromFile:
|
|
7869 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-11.txt')
|
|
7870 |
|
|
7871 |
"Created: / 11-05-2013 / 19:48:03 / jirka"
|
|
7872 |
!
|
|
7873 |
|
|
7874 |
test_fn_upper_case_12
|
|
7875 |
|
|
7876 |
| query result |
|
|
7877 |
|
|
7878 |
query := '
|
|
7879 |
(: Name: fn-upper-case-12 :)
|
|
7880 |
(: Description: Evaluation of upper-case function as an argument to the "fn:boolean" function:)
|
|
7881 |
|
|
7882 |
fn:boolean(fn:upper-case("abcde"))
|
|
7883 |
'.
|
|
7884 |
|
|
7885 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7886 |
|
|
7887 |
|
|
7888 |
result := interpreter evaluate: query.
|
|
7889 |
self
|
|
7890 |
assert: (self xqtsResultTextFromResult: result)
|
|
7891 |
= (self xqtsResultTextFromFile:
|
|
7892 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-12.txt')
|
|
7893 |
|
|
7894 |
"Created: / 11-05-2013 / 19:48:15 / jirka"
|
|
7895 |
!
|
|
7896 |
|
|
7897 |
test_fn_upper_case_13
|
|
7898 |
|
|
7899 |
| query result |
|
|
7900 |
|
|
7901 |
query := '
|
|
7902 |
(: Name: fn-upper-case-13 :)
|
|
7903 |
(: Description: Evaluation of upper-case function as an argument to the "fn:concat" function:)
|
|
7904 |
|
|
7905 |
fn:concat(fn:upper-case("abcde"), fn:upper-case("fghi"))
|
|
7906 |
'.
|
|
7907 |
|
|
7908 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7909 |
|
|
7910 |
|
|
7911 |
result := interpreter evaluate: query.
|
|
7912 |
self
|
|
7913 |
assert: (self xqtsResultTextFromResult: result)
|
|
7914 |
= (self xqtsResultTextFromFile:
|
|
7915 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-13.txt')
|
|
7916 |
|
|
7917 |
"Created: / 11-05-2013 / 19:48:26 / jirka"
|
|
7918 |
!
|
|
7919 |
|
|
7920 |
test_fn_upper_case_14
|
|
7921 |
|
|
7922 |
| query result |
|
|
7923 |
|
|
7924 |
query := '
|
|
7925 |
(: Name: fn-upper-case-14 :)
|
|
7926 |
(: Description: Evaluation of upper-case function as an argument to the "fn:not" function:)
|
|
7927 |
|
|
7928 |
fn:not(fn:upper-case("abcde"))
|
|
7929 |
'.
|
|
7930 |
|
|
7931 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7932 |
|
|
7933 |
|
|
7934 |
result := interpreter evaluate: query.
|
|
7935 |
self
|
|
7936 |
assert: (self xqtsResultTextFromResult: result)
|
|
7937 |
= (self xqtsResultTextFromFile:
|
|
7938 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-14.txt')
|
|
7939 |
|
|
7940 |
"Created: / 11-05-2013 / 19:48:49 / jirka"
|
|
7941 |
!
|
|
7942 |
|
|
7943 |
test_fn_upper_case_15
|
|
7944 |
|
|
7945 |
| query result |
|
|
7946 |
|
|
7947 |
query := '
|
|
7948 |
(: Name: fn-upper-case-15 :)
|
|
7949 |
(: Description: Evaluation of upper-case function with argument set to "%$#@!!":)
|
|
7950 |
|
|
7951 |
fn:upper-case("%$#@!!")
|
|
7952 |
'.
|
|
7953 |
|
|
7954 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7955 |
|
|
7956 |
|
|
7957 |
result := interpreter evaluate: query.
|
|
7958 |
self
|
|
7959 |
assert: (self xqtsResultTextFromResult: result)
|
|
7960 |
= (self xqtsResultTextFromFile:
|
|
7961 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-15.txt')
|
|
7962 |
|
|
7963 |
"Created: / 11-05-2013 / 19:49:11 / jirka"
|
|
7964 |
!
|
|
7965 |
|
|
7966 |
test_fn_upper_case_16
|
|
7967 |
|
|
7968 |
| query result |
|
|
7969 |
|
|
7970 |
query := '
|
|
7971 |
(: Name: fn-upper-case-16 :)
|
|
7972 |
(: Description: Evaluation of upper-case function with argument set to "upper-case":)
|
|
7973 |
|
|
7974 |
fn:upper-case("upper-case")
|
|
7975 |
'.
|
|
7976 |
|
|
7977 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
7978 |
|
|
7979 |
|
|
7980 |
result := interpreter evaluate: query.
|
|
7981 |
self
|
|
7982 |
assert: (self xqtsResultTextFromResult: result)
|
|
7983 |
= (self xqtsResultTextFromFile:
|
|
7984 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-16.txt')
|
|
7985 |
|
|
7986 |
"Created: / 11-05-2013 / 19:49:31 / jirka"
|
|
7987 |
!
|
|
7988 |
|
|
7989 |
test_fn_upper_case_17
|
|
7990 |
|
|
7991 |
| query result |
|
|
7992 |
|
|
7993 |
query := '
|
|
7994 |
(: Name: fn-upper-case-17 :)
|
|
7995 |
(: Description: Evaluation of upper-case function as part of a boolean expression:)
|
|
7996 |
|
|
7997 |
fn:upper-case("abc") and fn:upper-case("abc")
|
|
7998 |
'.
|
|
7999 |
|
|
8000 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
8001 |
|
|
8002 |
|
|
8003 |
result := interpreter evaluate: query.
|
|
8004 |
self
|
|
8005 |
assert: (self xqtsResultTextFromResult: result)
|
|
8006 |
= (self xqtsResultTextFromFile:
|
|
8007 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-17.txt')
|
|
8008 |
|
|
8009 |
"Created: / 11-05-2013 / 19:49:40 / jirka"
|
|
8010 |
!
|
|
8011 |
|
|
8012 |
test_fn_upper_case_2
|
|
8013 |
|
|
8014 |
| query result |
|
|
8015 |
|
|
8016 |
query := '
|
|
8017 |
(: Name: fn-upper-case-2 :)
|
|
8018 |
(: Description: Evaluation of upper-case function using the empty sequence :)
|
|
8019 |
(: Uses the count function to avoid empty file. :)
|
|
8020 |
|
|
8021 |
fn:count(fn:upper-case(()))
|
|
8022 |
'.
|
|
8023 |
|
|
8024 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
8025 |
|
|
8026 |
|
|
8027 |
result := interpreter evaluate: query.
|
|
8028 |
self
|
|
8029 |
assert: (self xqtsResultTextFromResult: result)
|
|
8030 |
= (self xqtsResultTextFromFile:
|
|
8031 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-2.txt')
|
|
8032 |
|
|
8033 |
"Created: / 11-05-2013 / 19:49:49 / jirka"
|
|
8034 |
!
|
|
8035 |
|
|
8036 |
test_fn_upper_case_3
|
|
8037 |
|
|
8038 |
| query result |
|
|
8039 |
|
|
8040 |
query := '
|
|
8041 |
(: Name: fn-upper-case-3 :)
|
|
8042 |
(: Description: Evaluation of upper-case function that uses only numbers as part of argument:)
|
|
8043 |
(: Use of count function to avoid empty file. :)
|
|
8044 |
fn:upper-case("12345")
|
|
8045 |
'.
|
|
8046 |
|
|
8047 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
8048 |
|
|
8049 |
|
|
8050 |
result := interpreter evaluate: query.
|
|
8051 |
self
|
|
8052 |
assert: (self xqtsResultTextFromResult: result)
|
|
8053 |
= (self xqtsResultTextFromFile:
|
|
8054 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-3.txt')
|
|
8055 |
|
|
8056 |
"Created: / 11-05-2013 / 19:49:57 / jirka"
|
|
8057 |
!
|
|
8058 |
|
|
8059 |
test_fn_upper_case_4
|
|
8060 |
|
|
8061 |
| query result |
|
|
8062 |
|
|
8063 |
query := '
|
|
8064 |
(: Name: fn-upper-case-4 :)
|
|
8065 |
(: Description: Evaluation of upper-case function that uses both numbers and letters as part of argument:)
|
|
8066 |
|
|
8067 |
fn:upper-case("12345abcd")
|
|
8068 |
'.
|
|
8069 |
|
|
8070 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
8071 |
|
|
8072 |
|
|
8073 |
result := interpreter evaluate: query.
|
|
8074 |
self
|
|
8075 |
assert: (self xqtsResultTextFromResult: result)
|
|
8076 |
= (self xqtsResultTextFromFile:
|
|
8077 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-4.txt')
|
|
8078 |
|
|
8079 |
"Created: / 11-05-2013 / 19:50:06 / jirka"
|
|
8080 |
!
|
|
8081 |
|
|
8082 |
test_fn_upper_case_5
|
|
8083 |
|
|
8084 |
| query result |
|
|
8085 |
|
|
8086 |
query := '
|
|
8087 |
(: Name: fn-upper-case-5 :)
|
|
8088 |
(: Description: Evaluation of upper-case function that uses only upper case letters as part of argument:)
|
|
8089 |
|
|
8090 |
fn:upper-case("ABCD")
|
|
8091 |
'.
|
|
8092 |
|
|
8093 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
8094 |
|
|
8095 |
|
|
8096 |
result := interpreter evaluate: query.
|
|
8097 |
self
|
|
8098 |
assert: (self xqtsResultTextFromResult: result)
|
|
8099 |
= (self xqtsResultTextFromFile:
|
|
8100 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-5.txt')
|
|
8101 |
|
|
8102 |
"Created: / 11-05-2013 / 19:50:13 / jirka"
|
|
8103 |
!
|
|
8104 |
|
|
8105 |
test_fn_upper_case_6
|
|
8106 |
|
|
8107 |
| query result |
|
|
8108 |
|
|
8109 |
query := '
|
|
8110 |
(: Name: fn-upper-case-6 :)
|
|
8111 |
(: Description: Evaluation of upper-case function that uses only lower case letters as part of argument:)
|
|
8112 |
|
|
8113 |
fn:upper-case("abcde")
|
|
8114 |
'.
|
|
8115 |
|
|
8116 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
8117 |
|
|
8118 |
|
|
8119 |
result := interpreter evaluate: query.
|
|
8120 |
self
|
|
8121 |
assert: (self xqtsResultTextFromResult: result)
|
|
8122 |
= (self xqtsResultTextFromFile:
|
|
8123 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-6.txt')
|
|
8124 |
|
|
8125 |
"Created: / 11-05-2013 / 19:50:22 / jirka"
|
|
8126 |
!
|
|
8127 |
|
|
8128 |
test_fn_upper_case_7
|
|
8129 |
|
|
8130 |
| query result |
|
|
8131 |
|
|
8132 |
query := '
|
|
8133 |
(: Name: fn-upper-case-7 :)
|
|
8134 |
(: Description: Evaluation of upper-case function that uses both upper and lower case letters as part of argument:)
|
|
8135 |
|
|
8136 |
fn:upper-case("ABCDEabcde")
|
|
8137 |
'.
|
|
8138 |
|
|
8139 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
8140 |
|
|
8141 |
|
|
8142 |
result := interpreter evaluate: query.
|
|
8143 |
self
|
|
8144 |
assert: (self xqtsResultTextFromResult: result)
|
|
8145 |
= (self xqtsResultTextFromFile:
|
|
8146 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-7.txt')
|
|
8147 |
|
|
8148 |
"Created: / 11-05-2013 / 19:50:30 / jirka"
|
|
8149 |
!
|
|
8150 |
|
|
8151 |
test_fn_upper_case_8
|
|
8152 |
|
|
8153 |
| query result |
|
|
8154 |
|
|
8155 |
query := '
|
|
8156 |
(: Name: fn-upper-case-8 :)
|
|
8157 |
(: Description: Evaluation of upper-case function that uses the empty string as part of argument:)
|
|
8158 |
(: Uses "fn:count" to avoid the empty file :)
|
|
8159 |
|
|
8160 |
fn:count(fn:upper-case(""))
|
|
8161 |
'.
|
|
8162 |
|
|
8163 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
8164 |
|
|
8165 |
|
|
8166 |
result := interpreter evaluate: query.
|
|
8167 |
self
|
|
8168 |
assert: (self xqtsResultTextFromResult: result)
|
|
8169 |
= (self xqtsResultTextFromFile:
|
|
8170 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-8.txt')
|
|
8171 |
|
|
8172 |
"Created: / 11-05-2013 / 19:50:41 / jirka"
|
|
8173 |
!
|
|
8174 |
|
|
8175 |
test_fn_upper_case_9
|
|
8176 |
|
|
8177 |
| query result |
|
|
8178 |
|
|
8179 |
query := '
|
|
8180 |
(: Name: fn-upper-case-9 :)
|
|
8181 |
(: Description: Evaluation of upper-case function that uses the "lower-case" as part of argument:)
|
|
8182 |
|
|
8183 |
fn:upper-case(lower-case("AbcDH"))
|
|
8184 |
'.
|
|
8185 |
|
|
8186 |
self xqtsBind: 'input-context' toContentsOf: 'emptydoc'.
|
|
8187 |
|
|
8188 |
|
|
8189 |
result := interpreter evaluate: query.
|
|
8190 |
self
|
|
8191 |
assert: (self xqtsResultTextFromResult: result)
|
|
8192 |
= (self xqtsResultTextFromFile:
|
|
8193 |
'Functions/AllStringFunc/GeneralStringFunc/UpperCaseFunc/fn-upper-case-9.txt')
|
|
8194 |
|
|
8195 |
"Created: / 11-05-2013 / 21:34:31 / houzvjir@fel.cvut.cz"
|
|
8196 |
! !
|
|
8197 |
|
|
8198 |
!XQTSAllString class methodsFor:'documentation'!
|
|
8199 |
|
|
8200 |
version_SVN
|
|
8201 |
^ '$Id:: $'
|
|
8202 |
! !
|