Skip to content

Commit 616392e

Browse files
committed
[test] add tests for fn:serialize with new option exist:insert-final-newline
1 parent 07f8804 commit 616392e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

exist-core/src/test/xquery/xquery3/serialize.xql

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,3 +846,25 @@ function ser:serialize-xml-134() {
846846
}
847847
return serialize((1 to 4)!text{.}, $params)
848848
};
849+
850+
declare
851+
%test:assertTrue
852+
function ser:exist-insert-final-newline-false() {
853+
let $doc := <root>
854+
<nested />
855+
</root>
856+
let $serialized := fn:serialize($doc,
857+
map {xs:QName("exist:insert-final-newline"): false()})
858+
return fn:ends-with($serialized, ">")
859+
};
860+
861+
declare
862+
%test:assertTrue
863+
function ser:exist-insert-final-newline-true() {
864+
let $doc := <root>
865+
<nested />
866+
</root>
867+
let $serialized := fn:serialize($doc,
868+
map {xs:QName("exist:insert-final-newline"): true()})
869+
return fn:ends-with($serialized, "&#x0A;")
870+
};

0 commit comments

Comments
 (0)