|
22 | 22 | xquery version "3.0";
|
23 | 23 |
|
24 | 24 | (:~ Additional tests for the fn:count function :)
|
25 |
| -module namespace count="http://exist-db.org/xquery/test/count"; |
| 25 | +module namespace cnt="http://exist-db.org/xquery/test/count"; |
26 | 26 |
|
27 | 27 | declare namespace test="http://exist-db.org/xquery/xqsuite";
|
28 | 28 |
|
29 | 29 | import module namespace xmldb="http://exist-db.org/xquery/xmldb";
|
30 | 30 |
|
31 |
| -declare variable $count:TEST_COLLECTION_NAME := "test-count"; |
32 |
| -declare variable $count:TEST_COLLECTION := "/db/" || $count:TEST_COLLECTION_NAME; |
33 |
| -declare variable $count:COLLECTION1_NAME := "test-count-1"; |
34 |
| -declare variable $count:COLLECTION2_NAME := "test-count-2"; |
35 |
| -declare variable $count:COLLECTION1 := $count:TEST_COLLECTION || "/" || $count:COLLECTION1_NAME; |
36 |
| -declare variable $count:COLLECTION2 := $count:TEST_COLLECTION || "/" || $count:COLLECTION2_NAME; |
| 31 | +declare variable $cnt:TEST_COLLECTION_NAME := "test-count"; |
| 32 | +declare variable $cnt:TEST_COLLECTION := "/db/" || $cnt:TEST_COLLECTION_NAME; |
| 33 | +declare variable $cnt:COLLECTION1_NAME := "test-count-1"; |
| 34 | +declare variable $cnt:COLLECTION2_NAME := "test-count-2"; |
| 35 | +declare variable $cnt:COLLECTION1 := $cnt:TEST_COLLECTION || "/" || $cnt:COLLECTION1_NAME; |
| 36 | +declare variable $cnt:COLLECTION2 := $cnt:TEST_COLLECTION || "/" || $cnt:COLLECTION2_NAME; |
37 | 37 |
|
38 | 38 | declare
|
39 | 39 | %test:setUp
|
40 |
| -function count:setup() { |
41 |
| - xmldb:create-collection("/db", $count:TEST_COLLECTION_NAME), |
42 |
| - xmldb:create-collection($count:TEST_COLLECTION, $count:COLLECTION1_NAME), |
43 |
| - xmldb:store($count:COLLECTION1, "test1.xml", <test/>), |
44 |
| - xmldb:create-collection($count:TEST_COLLECTION, $count:COLLECTION2_NAME), |
45 |
| - xmldb:store($count:COLLECTION2, "test2xml", <test/>) |
| 40 | +function cnt:setup() { |
| 41 | + xmldb:create-collection("/db", $cnt:TEST_COLLECTION_NAME), |
| 42 | + xmldb:create-collection($cnt:TEST_COLLECTION, $cnt:COLLECTION1_NAME), |
| 43 | + xmldb:store($cnt:COLLECTION1, "test1.xml", <test/>), |
| 44 | + xmldb:create-collection($cnt:TEST_COLLECTION, $cnt:COLLECTION2_NAME), |
| 45 | + xmldb:store($cnt:COLLECTION2, "test2xml", <test/>) |
46 | 46 | };
|
47 | 47 |
|
48 | 48 | declare
|
49 | 49 | %test:tearDown
|
50 |
| -function count:cleanup() { |
51 |
| - xmldb:remove($count:TEST_COLLECTION) |
| 50 | +function cnt:cleanup() { |
| 51 | + xmldb:remove($cnt:TEST_COLLECTION) |
52 | 52 | };
|
53 | 53 |
|
54 | 54 | declare
|
55 | 55 | %test:assertEquals(1, 1)
|
56 |
| -function count:arg-self-on-stored() { |
57 |
| - (collection($count:COLLECTION1)/*, collection($count:COLLECTION2)/*)/count(.) |
| 56 | +function cnt:arg-self-on-stored() { |
| 57 | + (collection($cnt:COLLECTION1)/*, collection($cnt:COLLECTION2)/*)/count(.) |
58 | 58 | };
|
59 | 59 |
|
60 | 60 | declare
|
61 | 61 | %test:assertEquals(1, 1, 1)
|
62 |
| -function count:arg-self-on-constructed() { |
| 62 | +function cnt:arg-self-on-constructed() { |
63 | 63 | (<a/>, <b/>, <c/>)/count(.)
|
64 | 64 | };
|
0 commit comments