Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
teusbenschop committed Jan 7, 2024
1 parent 814e74b commit 00f8e76
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
9 changes: 6 additions & 3 deletions unittests/styles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ TEST (styles, css)
Styles_Css styles_css = Styles_Css (&request, "testsheet");
styles_css.generate ();
string css = styles_css.css ();
//filter_url_file_put_contents ("/tmp/css.css", css);
string standard = filter_url_file_get_contents (filter_url_create_path ({"unittests", "tests", "basic.css"}));
EXPECT_EQ (standard, css);
}
Expand All @@ -58,6 +59,7 @@ TEST (styles, css)
styles_css.exports ();
styles_css.generate ();
string css = styles_css.css ();
//filter_url_file_put_contents ("/tmp/css.css", css);
string standard = filter::strings::trim (filter_url_file_get_contents (filter_url_create_path ({"unittests", "tests", "exports.css"})));
EXPECT_EQ (standard, css);
}
Expand All @@ -71,6 +73,7 @@ TEST (styles, css)
styles_css.editor ();
styles_css.generate ();
string css = styles_css.css ();
//filter_url_file_put_contents ("/tmp/css.css", css);
string standard = filter::strings::trim (filter_url_file_get_contents (filter_url_create_path ({"unittests", "tests", "editor.css"})));
//filter_url_file_put_contents ("editor.css", css);
EXPECT_EQ (standard, css);
Expand Down Expand Up @@ -233,18 +236,18 @@ TEST (styles, css)
vector <string> markers {};

markers = database_styles.getMarkers (styles_logic_standard_sheet ());
EXPECT_EQ (204, static_cast<int>(markers.size ()));
EXPECT_EQ (205, static_cast<int>(markers.size ()));

markers = database_styles.getMarkers ("testsheet");
EXPECT_EQ (204, static_cast<int>(markers.size ()));
EXPECT_EQ (205, static_cast<int>(markers.size ()));

string marker {"p"};
if (find (markers.begin (), markers.end (), marker) == markers.end ()) EXPECT_EQ (marker, "not found");
marker = "add";
if (find (markers.begin (), markers.end (), marker) == markers.end ()) EXPECT_EQ (marker, "not found");

map <string, string> markers_names = database_styles.getMarkersAndNames ("testsheet");
EXPECT_EQ (204, static_cast<int>(markers_names.size()));
EXPECT_EQ (205, static_cast<int>(markers_names.size()));
EXPECT_EQ ("Blank line", markers_names ["b"]);
EXPECT_EQ ("Normal paragraph", markers_names ["p"]);
EXPECT_EQ ("Translator’s addition", markers_names ["add"]);
Expand Down
4 changes: 4 additions & 0 deletions unittests/tests/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,10 @@ text-align: center;
margin-bottom: 4mm;
page-break-inside: avoid;
}
.sup, .i-sup {
font-size: x-small;
vertical-align: super;
}
.tl, .i-tl {
font-style: italic;
}
Expand Down
4 changes: 4 additions & 0 deletions unittests/tests/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,10 @@ text-align: center;
margin-bottom: 4mm;
page-break-inside: avoid;
}
.sup, .i-sup {
font-size: x-small;
vertical-align: super;
}
.tl, .i-tl {
font-style: italic;
}
Expand Down
6 changes: 5 additions & 1 deletion unittests/tests/exports.css
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,10 @@ text-align: center;
margin-bottom: 4mm;
page-break-inside: avoid;
}
.sup, .i-sup {
font-size: x-small;
vertical-align: super;
}
.tl, .i-tl {
font-style: italic;
}
Expand Down Expand Up @@ -706,4 +710,4 @@ font-style: italic;
.xt, .i-xt {
}
.xta, .i-xta {
}
}

0 comments on commit 00f8e76

Please sign in to comment.