Add test for #767

Without a test for this fix, a regression will happen again.

Original PR #767 aka commit 4fed875107
This commit is contained in:
Floris Bruynooghe
2019-10-30 20:10:29 +01:00
committed by holger krekel
parent b01c842d7c
commit 78030e4a31

View File

@@ -1966,4 +1966,13 @@ mod tests {
let draft_text = draft.get_text();
assert_eq!(msg_text, draft_text);
}
#[test]
fn test_add_contact_to_chat_ex_add_self() {
// Adding self to a contact should succeed, even though it's pointless.
let t = test_context(Some(Box::new(logging_cb)));
let chat_id = create_group_chat(&t.ctx, VerifiedStatus::Unverified, "foo").unwrap();
let added = add_contact_to_chat_ex(&t.ctx, chat_id, DC_CONTACT_ID_SELF, false).unwrap();
assert_eq!(added, false);
}
}