Turn on unit tests by default, and ifdef out a few of them

This commit is contained in:
Tim Wojtulewicz 2022-10-27 16:36:06 -07:00 committed by Tomer Lev
parent 88b3a449a7
commit bf06cc9c2f
5 changed files with 30 additions and 4 deletions

View file

@ -110,12 +110,13 @@ static std::string prefix_basename_with(const std::string& path, const std::stri
TEST_CASE("writers.ascii prefix_basename_with")
{
CHECK(prefix_basename_with("", ".shadow.") == ".shadow.");
CHECK(prefix_basename_with("conn.log", ".shadow.") == ".shadow.conn.log");
CHECK(prefix_basename_with("/conn.log", ".shadow.") == "/.shadow.conn.log");
#ifdef _MSC_VER
// TODO: adapt this test to Windows paths
#else
CHECK(prefix_basename_with("a/conn.log", ".shadow.") == "a/.shadow.conn.log");
CHECK(prefix_basename_with("/a/conn.log", ".shadow.") == "/a/.shadow.conn.log");
CHECK(prefix_basename_with("a/b/conn.log", ".shadow.") == "a/b/.shadow.conn.log");
#endif
}
static std::optional<LeftoverLog> parse_shadow_log(const std::string& fname)