mirror of
https://github.com/djcb/mu.git
synced 2024-06-26 07:29:17 +02:00
tests: update for move_message API update
This commit is contained in:
parent
0b516c18c2
commit
da7c3b0c9a
|
@ -565,9 +565,12 @@ Boo!
|
||||||
/*
|
/*
|
||||||
* mark as read, i.e. move to cur/; ensure it really moved.
|
* mark as read, i.e. move to cur/; ensure it really moved.
|
||||||
*/
|
*/
|
||||||
auto moved_msg = store.move_message(old_docid, Nothing, Flags::Seen, rename);
|
auto move_opts{rename ? Store::MoveOptions::ChangeName : Store::MoveOptions::None};
|
||||||
assert_valid_result(moved_msg);
|
auto moved_msgs = store.move_message(old_docid, Nothing, Flags::Seen, move_opts);
|
||||||
const auto new_path = moved_msg->path();
|
assert_valid_result(moved_msgs);
|
||||||
|
g_assert_true(moved_msgs->size() == 1);
|
||||||
|
const auto& moved_msg{moved_msgs->at(0).second};
|
||||||
|
const auto new_path = moved_msg.path();
|
||||||
if (!rename)
|
if (!rename)
|
||||||
assert_equal(new_path, store.properties().root_maildir + "/inbox/cur/msg:2,S");
|
assert_equal(new_path, store.properties().root_maildir + "/inbox/cur/msg:2,S");
|
||||||
g_assert_cmpuint(store.size(), ==, 1);
|
g_assert_cmpuint(store.size(), ==, 1);
|
||||||
|
@ -576,7 +579,7 @@ Boo!
|
||||||
|
|
||||||
/* also ensure that the cached sexp for the message has been updated;
|
/* also ensure that the cached sexp for the message has been updated;
|
||||||
* that's what mu4e uses */
|
* that's what mu4e uses */
|
||||||
const auto moved_sexp{moved_msg->sexp()};
|
const auto moved_sexp{moved_msg.sexp()};
|
||||||
//std::cerr << "@@ " << *moved_msg << '\n';
|
//std::cerr << "@@ " << *moved_msg << '\n';
|
||||||
g_assert_true(moved_sexp.plistp());
|
g_assert_true(moved_sexp.plistp());
|
||||||
g_assert_true(moved_sexp.has_prop(":path"));
|
g_assert_true(moved_sexp.has_prop(":path"));
|
||||||
|
|
|
@ -373,14 +373,16 @@ Yes, that would be excellent.
|
||||||
|
|
||||||
// Move the message from new->cur
|
// Move the message from new->cur
|
||||||
std::this_thread::sleep_for(1s); /* ctime should change */
|
std::this_thread::sleep_for(1s); /* ctime should change */
|
||||||
const auto msg3 = store->move_message(msg->docid(), {}, Flags::Seen);
|
const auto msgs3 = store->move_message(msg->docid(), {}, Flags::Seen);
|
||||||
assert_valid_result(msg3);
|
assert_valid_result(msgs3);
|
||||||
assert_equal(msg3->maildir(), "/a");
|
g_assert_true(msgs3->size() == 1);
|
||||||
assert_equal(msg3->path(), tempdir2.path() + "/Maildir/a/cur/msg:2,S");
|
const auto& msg3{msgs3->at(0).second};
|
||||||
g_assert_true(::access(msg3->path().c_str(), R_OK)==0);
|
assert_equal(msg3.maildir(), "/a");
|
||||||
|
assert_equal(msg3.path(), tempdir2.path() + "/Maildir/a/cur/msg:2,S");
|
||||||
|
g_assert_true(::access(msg3.path().c_str(), R_OK)==0);
|
||||||
g_assert_false(::access(oldpath.c_str(), R_OK)==0);
|
g_assert_false(::access(oldpath.c_str(), R_OK)==0);
|
||||||
|
|
||||||
g_debug("%s", msg3->sexp().to_string().c_str());
|
g_debug("%s", msg3.sexp().to_string().c_str());
|
||||||
g_assert_cmpuint(store->size(), ==, 1);
|
g_assert_cmpuint(store->size(), ==, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user