Skip to content

Commit

Permalink
test: make test_group_with_removed_message_id less flaky
Browse files Browse the repository at this point in the history
It failed in CI once, apparently
because "Gr." was generated inside the group ID.
  • Loading branch information
link2xt committed May 21, 2023
1 parent 0dd9e3a commit c7ad0b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5147,9 +5147,11 @@ mod tests {
// Alice has an SMTP-server replacing the `Message-ID:`-header (as done eg. by outlook.com).
let sent_msg = alice.pop_sent_msg().await;
let msg = sent_msg.payload();
assert_eq!(msg.match_indices("Gr.").count(), 2);
assert_eq!(msg.match_indices("Message-ID: <Gr.").count(), 1);
assert_eq!(msg.match_indices("References: <Gr.").count(), 1);
let msg = msg.replace("Message-ID: <Gr.", "Message-ID: <XXX");
assert_eq!(msg.match_indices("Gr.").count(), 1);
assert_eq!(msg.match_indices("Message-ID: <Gr.").count(), 0);
assert_eq!(msg.match_indices("References: <Gr.").count(), 1);

// Bob receives this message, he may detect group by `References:`- or `Chat-Group:`-header
receive_imf(&bob, msg.as_bytes(), false).await.unwrap();
Expand Down

0 comments on commit c7ad0b1

Please sign in to comment.