@@ -2546,8 +2546,9 @@ mod tests {
2546
2546
// Alice creates a group with Bob and Claire and then removes Bob.
2547
2547
let alice = TestContext :: new_alice ( ) . await ;
2548
2548
2549
+ let claire_addr = "claire@foo.de" ;
2549
2550
let bob_id = Contact :: create ( & alice, "Bob" , "bob@example.net" ) . await ?;
2550
- let claire_id = Contact :: create ( & alice, "Claire" , "claire@foo.de" ) . await ?;
2551
+ let claire_id = Contact :: create ( & alice, "Claire" , claire_addr ) . await ?;
2551
2552
2552
2553
let alice_chat_id = create_group_chat ( & alice, ProtectionStatus :: Unprotected , "foo" ) . await ?;
2553
2554
add_contact_to_chat ( & alice, alice_chat_id, bob_id) . await ?;
@@ -2563,10 +2564,17 @@ mod tests {
2563
2564
. get_first_header ( "To" )
2564
2565
. context ( "no To: header parsed" ) ?;
2565
2566
let to = addrparse_header ( to) ?;
2566
- let mailbox = to
2567
- . extract_single_info ( )
2568
- . context ( "to: field does not contain exactly one address" ) ?;
2569
- assert_eq ! ( mailbox. addr, "bob@example.net" ) ;
2567
+ for to_addr in to. iter ( ) {
2568
+ match to_addr {
2569
+ mailparse:: MailAddr :: Single ( ref info) => {
2570
+ // Addresses should be of existing members (Alice and Bob) and not Claire.
2571
+ assert_ne ! ( info. addr, claire_addr) ;
2572
+ }
2573
+ mailparse:: MailAddr :: Group ( _) => {
2574
+ panic ! ( "Group addresses are not expected here" ) ;
2575
+ }
2576
+ }
2577
+ }
2570
2578
2571
2579
Ok ( ( ) )
2572
2580
}
0 commit comments