Fix test, print exceptions.

This commit is contained in:
tastytea 2021-08-20 17:38:12 +02:00
parent 2bede91fb7
commit 1e0cde8a4b
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 10 additions and 5 deletions

View File

@ -6,6 +6,7 @@
#include <clocale>
#include <exception>
#include <iostream>
#include <string>
#include <vector>
@ -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;
}