add tests for error mode

This commit is contained in:
ado
2020-12-27 16:51:59 +01:00
parent bb6296ef6e
commit 5a1e5b3877
2 changed files with 36 additions and 0 deletions

View File

@@ -322,3 +322,16 @@ TEST_CASE("testing ss:ne restriction (not empty)") {
CHECK(tup == extracted_vector);
}
}
TEST_CASE("testing error mode") {
ss::converter c;
c.convert<int>("junk");
CHECK(!c.valid());
CHECK(!c.error_msg().empty());
c.set_error_mode(ss::error_mode::Bool);
c.convert<int>("junk");
CHECK(!c.valid());
CHECK(c.error_msg().empty());
}