Update tests for search::headline() and search::page().
This commit is contained in:
parent
9708bb69c8
commit
5e89a71e00
@ -26,7 +26,7 @@ SCENARIO("Searching helpers work as intended")
|
||||
text = "Moss";
|
||||
try
|
||||
{
|
||||
epubgrep::search::cleanup_text(text);
|
||||
text = epubgrep::search::cleanup_text(text).text;
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
@ -46,7 +46,7 @@ SCENARIO("Searching helpers work as intended")
|
||||
text = "💖\r\r🦝";
|
||||
try
|
||||
{
|
||||
epubgrep::search::cleanup_text(text);
|
||||
text = epubgrep::search::cleanup_text(text).text;
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
@ -66,7 +66,7 @@ SCENARIO("Searching helpers work as intended")
|
||||
text = "Moss\n\n\n\n\n\nis good.";
|
||||
try
|
||||
{
|
||||
epubgrep::search::cleanup_text(text);
|
||||
text = epubgrep::search::cleanup_text(text).text;
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
@ -91,8 +91,8 @@ SCENARIO("Searching helpers work as intended")
|
||||
text = "… <h3>Soup</h3> …";
|
||||
try
|
||||
{
|
||||
epubgrep::search::cleanup_text(text);
|
||||
text = epubgrep::search::headline(text);
|
||||
auto file{epubgrep::search::cleanup_text(text)};
|
||||
text = epubgrep::search::headline(file, text.size());
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
@ -113,8 +113,8 @@ SCENARIO("Searching helpers work as intended")
|
||||
"road to nowhere</h2> …";
|
||||
try
|
||||
{
|
||||
epubgrep::search::cleanup_text(text);
|
||||
text = epubgrep::search::headline(text);
|
||||
auto file{epubgrep::search::cleanup_text(text)};
|
||||
text = epubgrep::search::headline(file, text.size());
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
@ -134,8 +134,8 @@ SCENARIO("Searching helpers work as intended")
|
||||
text = "<html><hr>The long<section>road to nowhere</section>";
|
||||
try
|
||||
{
|
||||
epubgrep::search::cleanup_text(text);
|
||||
text = epubgrep::search::headline(text);
|
||||
auto file{epubgrep::search::cleanup_text(text)};
|
||||
text = epubgrep::search::headline(file, text.size());
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
@ -160,8 +160,8 @@ SCENARIO("Searching helpers work as intended")
|
||||
text = R"(… <span epub:type="pagebreak" … title="69"/> …)";
|
||||
try
|
||||
{
|
||||
epubgrep::search::cleanup_text(text);
|
||||
text = epubgrep::search::page(text);
|
||||
auto file{epubgrep::search::cleanup_text(text)};
|
||||
text = epubgrep::search::page(file, text.size());
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
@ -181,8 +181,8 @@ SCENARIO("Searching helpers work as intended")
|
||||
text = R"(… <span role="doc-pagebreak" … aria-label="69"/> …)";
|
||||
try
|
||||
{
|
||||
epubgrep::search::cleanup_text(text);
|
||||
text = epubgrep::search::page(text);
|
||||
auto file{epubgrep::search::cleanup_text(text)};
|
||||
text = epubgrep::search::page(file, text.size());
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user