Skip to content

Commit f758d8f

Browse files
committed
[test] Add further XQuery tests for reserved names
1 parent 06b1b66 commit f758d8f

File tree

2 files changed

+56
-3
lines changed

2 files changed

+56
-3
lines changed

exist-core/src/main/antlr/org/exist/xquery/parser/XQuery.g

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2227,9 +2227,9 @@ reservedKeywords returns [String name]
22272227
|
22282228
"copy-namespaces" { name = "copy-namespaces"; }
22292229
|
2230-
"empty-sequence" { name = "empty-sequence"; }
2231-
|
2232-
"schema-element" { name = "schema-element"; }
2230+
"empty-sequence" { name = "empty-sequence"; }
2231+
|
2232+
"schema-element" { name = "schema-element"; }
22332233
;
22342234

22352235
/**
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
(:
2+
: eXist-db Open Source Native XML Database
3+
: Copyright (C) 2001 The eXist-db Authors
4+
:
5+
6+
: http://www.exist-db.org
7+
:
8+
: This library is free software; you can redistribute it and/or
9+
: modify it under the terms of the GNU Lesser General Public
10+
: License as published by the Free Software Foundation; either
11+
: version 2.1 of the License, or (at your option) any later version.
12+
:
13+
: This library is distributed in the hope that it will be useful,
14+
: but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
: Lesser General Public License for more details.
17+
:
18+
: You should have received a copy of the GNU Lesser General Public
19+
: License along with this library; if not, write to the Free Software
20+
: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
:)
22+
xquery version "3.0";
23+
24+
module namespace rnt = "http://exist-db.org/test/reserved-names";
25+
26+
declare namespace test = "http://exist-db.org/xquery/xqsuite";
27+
28+
29+
declare
30+
%test:assertEquals('<x copy-namespaces="a" empty-sequence="b" schema-element="c"/>')
31+
function rnt:attribute-direct-constructor() {
32+
<x copy-namespaces="a" empty-sequence="b" schema-element="c"/>
33+
};
34+
35+
declare
36+
%test:assertEquals('<x copy-namespaces="a" empty-sequence="b" schema-element="c"/>')
37+
function rnt:attribute-partial-computed-constructor() {
38+
element x {
39+
attribute copy-namespaces { "a" },
40+
attribute empty-sequence { "b" },
41+
attribute schema-element { "c" }
42+
}
43+
};
44+
45+
declare
46+
%test:assertEquals('<x copy-namespaces="a" empty-sequence="b" schema-element="c"/>')
47+
function rnt:attribute-complete-computed-constructor() {
48+
element { "x" } {
49+
attribute { "copy-namespaces" } { "a" },
50+
attribute { "empty-sequence" } { "b" },
51+
attribute { "schema-element" } { "c" }
52+
}
53+
};

0 commit comments

Comments
 (0)