From 5e89a71e0043b7ceedb085921acc94aef915e2e4 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 6 Jun 2021 22:11:45 +0200 Subject: [PATCH] Update tests for search::headline() and search::page(). --- tests/test_search_helpers.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/test_search_helpers.cpp b/tests/test_search_helpers.cpp index 8554155..d9026a6 100644 --- a/tests/test_search_helpers.cpp +++ b/tests/test_search_helpers.cpp @@ -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 = "ā€¦

Soup

ā€¦"; 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 ā€¦"; 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 = "
The long
road to nowhere
"; 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"(ā€¦ ā€¦)"; 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"(ā€¦ ā€¦)"; 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 &) {