Add another test for search::headline().
This commit is contained in:
parent
790e60a055
commit
59ceaa7cdc
@ -128,6 +128,27 @@ SCENARIO("Searching helpers work as intended")
|
||||
REQUIRE(text == "The long road to nowhere");
|
||||
}
|
||||
}
|
||||
|
||||
WHEN("There are tags that start with h but are not headlines")
|
||||
{
|
||||
text = "<html><hr>The long<section>road to nowhere</section>";
|
||||
try
|
||||
{
|
||||
epubgrep::search::cleanup_text(text);
|
||||
text = epubgrep::search::headline(text);
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
exception = true;
|
||||
}
|
||||
|
||||
THEN("No exception is thrown")
|
||||
AND_THEN("No headline is extracted")
|
||||
{
|
||||
REQUIRE_FALSE(exception);
|
||||
REQUIRE(text.empty());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("page() does what it should do")
|
||||
|
Loading…
x
Reference in New Issue
Block a user