Skip to content

Commit

Permalink
[bugfix] Avoid reserved keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
adamretter committed Jun 13, 2023
1 parent b28f501 commit caf2268
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions exist-core/src/test/xquery/count.xql
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,43 @@
xquery version "3.0";

(:~ Additional tests for the fn:count function :)
module namespace count="http://exist-db.org/xquery/test/count";
module namespace cnt="http://exist-db.org/xquery/test/count";

declare namespace test="http://exist-db.org/xquery/xqsuite";

import module namespace xmldb="http://exist-db.org/xquery/xmldb";

declare variable $count:TEST_COLLECTION_NAME := "test-count";
declare variable $count:TEST_COLLECTION := "/db/" || $count:TEST_COLLECTION_NAME;
declare variable $count:COLLECTION1_NAME := "test-count-1";
declare variable $count:COLLECTION2_NAME := "test-count-2";
declare variable $count:COLLECTION1 := $count:TEST_COLLECTION || "/" || $count:COLLECTION1_NAME;
declare variable $count:COLLECTION2 := $count:TEST_COLLECTION || "/" || $count:COLLECTION2_NAME;
declare variable $cnt:TEST_COLLECTION_NAME := "test-count";
declare variable $cnt:TEST_COLLECTION := "/db/" || $cnt:TEST_COLLECTION_NAME;
declare variable $cnt:COLLECTION1_NAME := "test-count-1";
declare variable $cnt:COLLECTION2_NAME := "test-count-2";
declare variable $cnt:COLLECTION1 := $cnt:TEST_COLLECTION || "/" || $cnt:COLLECTION1_NAME;
declare variable $cnt:COLLECTION2 := $cnt:TEST_COLLECTION || "/" || $cnt:COLLECTION2_NAME;

declare
%test:setUp
function count:setup() {
xmldb:create-collection("/db", $count:TEST_COLLECTION_NAME),
xmldb:create-collection($count:TEST_COLLECTION, $count:COLLECTION1_NAME),
xmldb:store($count:COLLECTION1, "test1.xml", <test/>),
xmldb:create-collection($count:TEST_COLLECTION, $count:COLLECTION2_NAME),
xmldb:store($count:COLLECTION2, "test2xml", <test/>)
function cnt:setup() {
xmldb:create-collection("/db", $cnt:TEST_COLLECTION_NAME),
xmldb:create-collection($cnt:TEST_COLLECTION, $cnt:COLLECTION1_NAME),
xmldb:store($cnt:COLLECTION1, "test1.xml", <test/>),
xmldb:create-collection($cnt:TEST_COLLECTION, $cnt:COLLECTION2_NAME),
xmldb:store($cnt:COLLECTION2, "test2xml", <test/>)
};

declare
%test:tearDown
function count:cleanup() {
xmldb:remove($count:TEST_COLLECTION)
function cnt:cleanup() {
xmldb:remove($cnt:TEST_COLLECTION)
};

declare
%test:assertEquals(1, 1)
function count:arg-self-on-stored() {
(collection($count:COLLECTION1)/*, collection($count:COLLECTION2)/*)/count(.)
function cnt:arg-self-on-stored() {
(collection($cnt:COLLECTION1)/*, collection($cnt:COLLECTION2)/*)/count(.)
};

declare
%test:assertEquals(1, 1, 1)
function count:arg-self-on-constructed() {
function cnt:arg-self-on-constructed() {
(<a/>, <b/>, <c/>)/count(.)
};

0 comments on commit caf2268

Please sign in to comment.