Add test for HTML tags in titles.
This commit is contained in:
parent
785fba691f
commit
9c307ab0fd
|
@ -106,6 +106,28 @@ SCENARIO("Searching helpers work as intended")
|
|||
REQUIRE(text == "Soup");
|
||||
}
|
||||
}
|
||||
|
||||
WHEN("There is a <span> in the h2 headline")
|
||||
{
|
||||
text = "… <h2>The <span class=\"long\">long</span> "
|
||||
"road to nowhere</h2> …";
|
||||
try
|
||||
{
|
||||
epubgrep::search::cleanup_text(text);
|
||||
text = epubgrep::search::headline(text);
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
exception = true;
|
||||
}
|
||||
|
||||
THEN("No exception is thrown")
|
||||
AND_THEN("The headline is correctly extracted")
|
||||
{
|
||||
REQUIRE_FALSE(exception);
|
||||
REQUIRE(text == "The long road to nowhere");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("page() does what it should do")
|
||||
|
|
Loading…
Reference in New Issue
Block a user