Skip to content

Commit

Permalink
adapted tests to reverted code in libfolia
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed Oct 26, 2024
1 parent b864df3 commit 50c3655
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
13 changes: 7 additions & 6 deletions src/foliatest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ void test0() {
assertTrue( bla["dat"] == " ra ar" );
assertEqual ( bla["dat"] , string(" ra ar") );
assertThrow( bla = getArgs( "dit='fout' = " ), ArgsError );
#if FOLIA_INT_VERSION >= 221
assertThrow( bla = getArgs( "dit=fout dit=dubbel" ), ArgsError );
#endif
// #if FOLIA_INT_VERSION >= 221
// assertThrow( bla = getArgs( "dit=fout dit=dubbel" ), ArgsError );
// #endif
assertNoThrow( bla = getArgs( "cls='o\\'k'" ) );
assertTrue( bla["cls"] == "o'k" );
assertNoThrow( bla = getArgs( "class='o\\k'" ) );
Expand Down Expand Up @@ -1043,9 +1043,10 @@ void correction_test009b(){
FoliaElement *sent = new Sentence( args );
nV.push_back(sent);
Correction *c;
#if FOLIA_INT_VERSION >= 221
assertThrow( c = node->correct( oV, cV, nV, sV, args ), DuplicateAttributeError );
#elif FOLIA_INT_VERSION >= 218
// #if FOLIA_INT_VERSION >= 221
// assertThrow( c = node->correct( oV, cV, nV, sV, args ), DuplicateAttributeError );
// #elif FOLIA_INT_VERSION >= 218
#if FOLIA_INT_VERSION >= 218
assertThrow( c = node->correct( oV, cV, nV, sV, args ), XmlError );
#else
c = node->correct( oV, cV, nV, sV, args );
Expand Down
8 changes: 4 additions & 4 deletions src/sanity_tests.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2296,10 +2296,10 @@ void sanity_test141( ){
int stat = system( "diff /tmp/test141.xml tests/test141.xml.ok" );
assertMessage( "/tmp/test141.xml tests/test141.xml.ok differ!",
(stat == 0) );
#else
int stat = system( "diff /tmp/test141.xml tests/test141-221.xml.ok" );
assertMessage( "/tmp/test141.xml tests/test141-221.xml.ok differ!",
(stat == 0) );
// #else
// int stat = system( "diff /tmp/test141.xml tests/test141-221.xml.ok" );
// assertMessage( "/tmp/test141.xml tests/test141-221.xml.ok differ!",
// (stat == 0) );
#endif
}

Expand Down
12 changes: 6 additions & 6 deletions src/text_tests.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1141,15 +1141,15 @@ void text_test13f(){

doc.setmode("strip");
assertEqual( doc.getmode(), "mode=strip,checktext,autodeclare," );
#if FOLIA_INT_VERSION < 221
//#if FOLIA_INT_VERSION < 221
assertEqual( doc.xmlstring(),
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<FoLiA xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://ilk.uvt.nl/folia\" xml:id=\"example\" generator=\"\" version=\"\"><metadata type=\"native\"><annotations><text-annotation set=\"https://raw.githubusercontent.com/proycon/folia/master/setdefinitions/text.foliaset.ttl\"/></annotations></metadata><text xml:id=\"example.text.1\"><s xml:id=\"example.s.1\"><t>De site staat online . </t><w xml:id=\"example.s.1.w.1\"><t>De</t></w><w xml:id=\"example.s.1.w.2\"><t>site</t></w><w xml:id=\"example.s.1.w.3\"><t>staat</t></w><w xml:id=\"example.s.1.w.4\"><t>online</t></w><w xml:id=\"example.s.1.w.5\"><t>.</t></w></s></text></FoLiA>\n" );
#else
assertEqual( doc.xmlstring(),
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<FoLiA xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://ilk.uvt.nl/folia\" xml:id=\"example\"><metadata type=\"native\"><annotations><text-annotation set=\"https://raw.githubusercontent.com/proycon/folia/master/setdefinitions/text.foliaset.ttl\"/></annotations></metadata><text xml:id=\"example.text.1\"><s xml:id=\"example.s.1\"><t>De site staat online . </t><w xml:id=\"example.s.1.w.1\"><t>De</t></w><w xml:id=\"example.s.1.w.2\"><t>site</t></w><w xml:id=\"example.s.1.w.3\"><t>staat</t></w><w xml:id=\"example.s.1.w.4\"><t>online</t></w><w xml:id=\"example.s.1.w.5\"><t>.</t></w></s></text></FoLiA>\n" );
#endif
// #else
// assertEqual( doc.xmlstring(),
// "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
// "<FoLiA xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://ilk.uvt.nl/folia\" xml:id=\"example\"><metadata type=\"native\"><annotations><text-annotation set=\"https://raw.githubusercontent.com/proycon/folia/master/setdefinitions/text.foliaset.ttl\"/></annotations></metadata><text xml:id=\"example.text.1\"><s xml:id=\"example.s.1\"><t>De site staat online . </t><w xml:id=\"example.s.1.w.1\"><t>De</t></w><w xml:id=\"example.s.1.w.2\"><t>site</t></w><w xml:id=\"example.s.1.w.3\"><t>staat</t></w><w xml:id=\"example.s.1.w.4\"><t>online</t></w><w xml:id=\"example.s.1.w.5\"><t>.</t></w></s></text></FoLiA>\n" );
// #endif
}

void text_test14(){
Expand Down

0 comments on commit 50c3655

Please sign in to comment.