mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 02:46:29 +03:00
feat: truncate long messages when loading instead of saving
This commit is contained in:
@@ -1286,12 +1286,12 @@ async fn test_mime_modified_large_plain() -> Result<()> {
|
||||
|
||||
{
|
||||
let mimemsg = MimeMessage::from_bytes(&t, long_txt.as_ref()).await?;
|
||||
assert!(mimemsg.is_mime_modified);
|
||||
assert!(
|
||||
mimemsg.parts[0].msg.matches("just repeated").count()
|
||||
<= DC_DESIRED_TEXT_LEN / REPEAT_TXT.len()
|
||||
assert!(!mimemsg.is_mime_modified);
|
||||
assert!(mimemsg.parts[0].msg.matches("just repeated").count() == REPEAT_CNT);
|
||||
assert_eq!(
|
||||
mimemsg.parts[0].msg.len() + 1,
|
||||
REPEAT_TXT.len() * REPEAT_CNT
|
||||
);
|
||||
assert!(mimemsg.parts[0].msg.len() <= DC_DESIRED_TEXT_LEN + DC_ELLIPSIS.len());
|
||||
}
|
||||
|
||||
for draft in [false, true] {
|
||||
|
||||
Reference in New Issue
Block a user