Skip to content

Commit

Permalink
add first test for the str module
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Aug 21, 2019
1 parent 9a1dc72 commit 237f42f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions testing/run-tests.xql
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import module namespace test="http://exist-db.org/xquery/xqsuite" at "resource:o

import module namespace wust="http://xquery.weber-gesamtausgabe.de/modules/wega-util-shared-tests" at "wega-util-shared-tests.xqm";
import module namespace dt="http://xquery.weber-gesamtausgabe.de/modules/date-tests" at "date-tests.xqm";
import module namespace st="http://xquery.weber-gesamtausgabe.de/modules/str-tests" at "str-tests.xqm";

(: the test:suite() function will run all the test-annotated functions in the module whose namespace URI you provide :)
test:suite((
util:list-functions("http://xquery.weber-gesamtausgabe.de/modules/date-tests"),
util:list-functions("http://xquery.weber-gesamtausgabe.de/modules/str-tests"),
util:list-functions("http://xquery.weber-gesamtausgabe.de/modules/wega-util-shared-tests")
))
19 changes: 19 additions & 0 deletions testing/str-tests.xqm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
xquery version "3.1";

module namespace st="http://xquery.weber-gesamtausgabe.de/modules/str-tests";

declare namespace test="http://exist-db.org/xquery/xqsuite";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace mei="http://www.music-encoding.org/ns/mei";
import module namespace str="http://xquery.weber-gesamtausgabe.de/modules/str" at "../xquery/str.xqm";

declare
%test:args("D'Alembert, Jean-Baptiste") %test:assertEquals("Jean-Baptiste D'Alembert")
%test:args("Orville, Philipp d'") %test:assertEquals("Philipp d’Orville")
%test:args("Heinrich L’Estocq") %test:assertEquals("Heinrich L’Estocq")
%test:args("L’Estocq, Heinrich") %test:assertEquals("Heinrich L’Estocq")
%test:args("Ordoñez, Carlos d'") %test:assertEquals("Carlos d’Ordoñez")
%test:args("Caroline, geb. Gräfin Clary Aldringen, verw. Gräfin Wurmbrand") %test:assertEquals("Caroline, geb. Gräfin Clary Aldringen, verw. Gräfin Wurmbrand")
function st:test-print-forename-surname($name as xs:string) as xs:string {
str:print-forename-surname($name)
};

0 comments on commit 237f42f

Please sign in to comment.