Skip to content

Commit 484fdd4

Browse files
committed
[bugfix] Corrected incorrect tests that asserted the wrong results
1 parent 11cabd5 commit 484fdd4

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

exist-core/src/test/java/org/exist/xquery/XQueryFunctionsTest.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,7 @@ public void localName_contextItem_empty() throws XPathException, XMLDBException
606606
final ResourceSet result = existEmbeddedServer.executeQuery(
607607
"let $a := <a><b/></a>" +
608608
"return $a/b/c/fn:local-name()");
609-
final String r = (String) result.getResource(0).getContent();
610-
assertEquals("", r);
609+
assertEquals(0, result.getSize());
611610
}
612611

613612
@Test
@@ -657,8 +656,7 @@ public void name_contextItem_empty() throws XPathException, XMLDBException {
657656
final ResourceSet result = existEmbeddedServer.executeQuery(
658657
"let $a := <a><b/></a>" +
659658
"return $a/b/c/fn:name()");
660-
final String r = (String) result.getResource(0).getContent();
661-
assertEquals("", r);
659+
assertEquals(0, result.getSize());
662660
}
663661

664662
@Test
@@ -762,12 +760,11 @@ public void namespaceURI_contextItem() throws XPathException, XMLDBException {
762760
}
763761

764762
@Test
765-
public void namespaceURI_contextItem_empty() throws XPathException, XMLDBException {
763+
public void namespaceURI_contextItem_empty() throws XMLDBException {
766764
final ResourceSet result = existEmbeddedServer.executeQuery(
767765
"let $a := <a><b/></a>" +
768766
"return $a/exist:b/c/fn:namespace-uri()");
769-
final String r = (String) result.getResource(0).getContent();
770-
assertEquals("", r);
767+
assertEquals(0, result.getSize());
771768
}
772769

773770
@Test

exist-core/src/test/xquery/fn.xql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function fnt:document-uri0_context() {
145145
};
146146

147147
declare
148-
%test:assertError("err:XPDY0002")
148+
%test:assertEmpty
149149
function fnt:document-uri0_context_empty() {
150150
root(collection('/db/fn-test')//bookies)/document-uri()
151151
};

0 commit comments

Comments
 (0)