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";
|
text = "Moss";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
epubgrep::search::cleanup_text(text);
|
text = epubgrep::search::cleanup_text(text).text;
|
||||||
}
|
}
|
||||||
catch (const std::exception &)
|
catch (const std::exception &)
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ SCENARIO("Searching helpers work as intended")
|
||||||
text = "💖\r\r🦝";
|
text = "💖\r\r🦝";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
epubgrep::search::cleanup_text(text);
|
text = epubgrep::search::cleanup_text(text).text;
|
||||||
}
|
}
|
||||||
catch (const std::exception &)
|
catch (const std::exception &)
|
||||||
{
|
{
|
||||||
|
@ -66,7 +66,7 @@ SCENARIO("Searching helpers work as intended")
|
||||||
text = "Moss\n\n\n\n\n\nis good.";
|
text = "Moss\n\n\n\n\n\nis good.";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
epubgrep::search::cleanup_text(text);
|
text = epubgrep::search::cleanup_text(text).text;
|
||||||
}
|
}
|
||||||
catch (const std::exception &)
|
catch (const std::exception &)
|
||||||
{
|
{
|
||||||
|
@ -91,8 +91,8 @@ SCENARIO("Searching helpers work as intended")
|
||||||
text = "… <h3>Soup</h3> …";
|
text = "… <h3>Soup</h3> …";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
epubgrep::search::cleanup_text(text);
|
auto file{epubgrep::search::cleanup_text(text)};
|
||||||
text = epubgrep::search::headline(text);
|
text = epubgrep::search::headline(file, text.size());
|
||||||
}
|
}
|
||||||
catch (const std::exception &)
|
catch (const std::exception &)
|
||||||
{
|
{
|
||||||
|
@ -113,8 +113,8 @@ SCENARIO("Searching helpers work as intended")
|
||||||
"road to nowhere</h2> …";
|
"road to nowhere</h2> …";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
epubgrep::search::cleanup_text(text);
|
auto file{epubgrep::search::cleanup_text(text)};
|
||||||
text = epubgrep::search::headline(text);
|
text = epubgrep::search::headline(file, text.size());
|
||||||
}
|
}
|
||||||
catch (const std::exception &)
|
catch (const std::exception &)
|
||||||
{
|
{
|
||||||
|
@ -134,8 +134,8 @@ SCENARIO("Searching helpers work as intended")
|
||||||
text = "<html><hr>The long<section>road to nowhere</section>";
|
text = "<html><hr>The long<section>road to nowhere</section>";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
epubgrep::search::cleanup_text(text);
|
auto file{epubgrep::search::cleanup_text(text)};
|
||||||
text = epubgrep::search::headline(text);
|
text = epubgrep::search::headline(file, text.size());
|
||||||
}
|
}
|
||||||
catch (const std::exception &)
|
catch (const std::exception &)
|
||||||
{
|
{
|
||||||
|
@ -160,8 +160,8 @@ SCENARIO("Searching helpers work as intended")
|
||||||
text = R"(… <span epub:type="pagebreak" … title="69"/> …)";
|
text = R"(… <span epub:type="pagebreak" … title="69"/> …)";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
epubgrep::search::cleanup_text(text);
|
auto file{epubgrep::search::cleanup_text(text)};
|
||||||
text = epubgrep::search::page(text);
|
text = epubgrep::search::page(file, text.size());
|
||||||
}
|
}
|
||||||
catch (const std::exception &)
|
catch (const std::exception &)
|
||||||
{
|
{
|
||||||
|
@ -181,8 +181,8 @@ SCENARIO("Searching helpers work as intended")
|
||||||
text = R"(… <span role="doc-pagebreak" … aria-label="69"/> …)";
|
text = R"(… <span role="doc-pagebreak" … aria-label="69"/> …)";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
epubgrep::search::cleanup_text(text);
|
auto file{epubgrep::search::cleanup_text(text)};
|
||||||
text = epubgrep::search::page(text);
|
text = epubgrep::search::page(file, text.size());
|
||||||
}
|
}
|
||||||
catch (const std::exception &)
|
catch (const std::exception &)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue