From 1e0cde8a4b8c598971bc9bab292e63dc2e5426db Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 20 Aug 2021 17:38:12 +0200 Subject: [PATCH] Fix test, print exceptions. --- tests/test_search_zip.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/test_search_zip.cpp b/tests/test_search_zip.cpp index 7efb143..d616600 100644 --- a/tests/test_search_zip.cpp +++ b/tests/test_search_zip.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -32,8 +33,9 @@ SCENARIO("Searching ZIP files works") opts.regex = epubgrep::options::regex_kind::extended; matches = epubgrep::search::search(zipfile, "📙+\\w?", opts); } - catch (const std::exception &) + catch (const std::exception &e) { + std::cerr << "EXCEPTION: " << e.what() << '\n'; exception = true; } @@ -53,8 +55,9 @@ SCENARIO("Searching ZIP files works") opts.context = 1; matches = epubgrep::search::search(zipfile, "📗", opts); } - catch (const std::exception &) + catch (const std::exception &e) { + std::cerr << "EXCEPTION: " << e.what() << '\n'; exception = true; } @@ -78,8 +81,9 @@ SCENARIO("Searching ZIP files works") matches = epubgrep::search::search(zipfile, R"([ \n])", opts); } - catch (const std::exception &) + catch (const std::exception &e) { + std::cerr << "EXCEPTION: " << e.what() << '\n'; exception = true; } @@ -114,12 +118,13 @@ SCENARIO("Searching ZIP files works") try { opts.context = 1; - opts.regex = epubgrep::options::regex_kind::extended; + opts.regex = epubgrep::options::regex_kind::perl; matches = epubgrep::search::search( zipfile, R"(work\s[\w]+\.\W[\w']+\Wstay)", opts); } - catch (const std::exception &) + catch (const std::exception &e) { + std::cerr << "EXCEPTION: " << e.what() << '\n'; exception = true; }