mirror of https://github.com/djcb/mu.git
mu-add: update unit test
This commit is contained in:
parent
cf6c5a36d7
commit
8b66491a72
|
@ -56,12 +56,9 @@ test_add_ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
auto res = run_mu_command(
|
auto res = run_command({MU_PROGRAM, "add", mu_format("--muhome={}", testhome),
|
||||||
mu_format("add --muhome={} {}",
|
MU_TESTMAILDIR "/cur/1220863042.12663_1.mindcrime!2,S"});
|
||||||
testhome,
|
assert_valid_command(res);
|
||||||
MU_TESTMAILDIR "/cur/1220863042.12663_1.mindcrime!2,S"));
|
|
||||||
assert_valid_result(res);
|
|
||||||
g_assert_cmpuint(*res,==,0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -71,15 +68,11 @@ test_add_ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // re-add the same
|
{ // re-add the same
|
||||||
auto res = run_mu_command(
|
auto res = run_command({MU_PROGRAM, "add", mu_format("--muhome={}",testhome),
|
||||||
mu_format("add --muhome={} {}",
|
MU_TESTMAILDIR "/cur/1220863042.12663_1.mindcrime!2,S"});
|
||||||
testhome,
|
assert_valid_command(res);
|
||||||
MU_TESTMAILDIR "/cur/1220863042.12663_1.mindcrime!2,S"));
|
|
||||||
assert_valid_result(res);
|
|
||||||
g_assert_cmpuint(*res,==,0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
auto&& store = Store::make(dbpath);
|
auto&& store = Store::make(dbpath);
|
||||||
assert_valid_result(store);
|
assert_valid_result(store);
|
||||||
|
@ -101,21 +94,18 @@ test_add_fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // wrong maildir
|
{ // wrong maildir
|
||||||
auto res = run_mu_command(
|
auto res = run_command({MU_PROGRAM, "add", mu_format("--muhome={}", testhome),
|
||||||
mu_format("add --muhome={} {}",
|
MU_TESTMAILDIR "/cur/1220863042.12663_1.mindcrime!2,S"});
|
||||||
testhome,
|
|
||||||
MU_TESTMAILDIR "/cur/1220863042.12663_1.mindcrime!2,S"));
|
|
||||||
assert_valid_result(res);
|
assert_valid_result(res);
|
||||||
g_assert_cmpuint(*res,!=,0);
|
g_assert_cmpuint(res->exit_code,!=,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{ // non-existent
|
{ // non-existent
|
||||||
auto res = run_mu_command(
|
auto res = run_command({MU_PROGRAM, "add", mu_format("--muhome={}", testhome),
|
||||||
mu_format("add --muhome={} {}",
|
"/foo/bar/non-existent"});
|
||||||
testhome, "/foo/bar/non-existent"));
|
|
||||||
assert_valid_result(res);
|
assert_valid_result(res);
|
||||||
g_assert_cmpuint(*res,!=,0);
|
g_assert_cmpuint(res->exit_code,!=,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_directory(testhome);
|
remove_directory(testhome);
|
||||||
|
|
Loading…
Reference in New Issue