test: don't "uniqify" link names during test

This commit is contained in:
Dirk-Jan C. Binnema
2023-04-09 11:02:58 +03:00
parent 1868e4f977
commit e43452fa18
4 changed files with 12 additions and 8 deletions

View File

@ -178,7 +178,11 @@ output_link(const Option<Message>& msg, const OutputInfo& info, const Options& o
else if (info.footer)
return true;
if (auto&& res = maildir_link(msg->path(), opts.find.linksdir); !res) {
/* during test, do not create "unique names" (i.e., names with path
* hashes), so we get a predictable result */
const auto unique_names{!g_getenv("MU_TEST")&&!g_test_initialized()};
if (auto&& res = maildir_link(msg->path(), opts.find.linksdir, unique_names); !res) {
res.error().fill_g_error(err);
return false;
}