Skip to content

Commit 7f7c76f

Browse files
committed
test: use assert_eq! to compare chatlist length
1 parent 3fe9a7b commit 7f7c76f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/chatlist.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ mod tests {
550550
let chats = Chatlist::try_load(&t, 0, Some("is:unread"), None)
551551
.await
552552
.unwrap();
553-
assert!(chats.len() == 1);
553+
assert_eq!(chats.len(), 1);
554554

555555
let chats = Chatlist::try_load(&t, DC_GCL_ARCHIVED_ONLY, None, None)
556556
.await
@@ -576,7 +576,7 @@ mod tests {
576576
.unwrap();
577577

578578
let chats = Chatlist::try_load(&t, 0, None, None).await.unwrap();
579-
assert!(chats.len() == 3);
579+
assert_eq!(chats.len(), 3);
580580
assert!(!Chat::load_from_db(&t, chats.get_chat_id(0).unwrap())
581581
.await
582582
.unwrap()
@@ -585,7 +585,7 @@ mod tests {
585585
let chats = Chatlist::try_load(&t, DC_GCL_FOR_FORWARDING, None, None)
586586
.await
587587
.unwrap();
588-
assert!(chats.len() == 2); // device chat cannot be written and is skipped on forwarding
588+
assert_eq!(chats.len(), 2); // device chat cannot be written and is skipped on forwarding
589589
assert!(Chat::load_from_db(&t, chats.get_chat_id(0).unwrap())
590590
.await
591591
.unwrap()
@@ -597,7 +597,7 @@ mod tests {
597597
let chats = Chatlist::try_load(&t, DC_GCL_FOR_FORWARDING, None, None)
598598
.await
599599
.unwrap();
600-
assert!(chats.len() == 1);
600+
assert_eq!(chats.len(), 1);
601601
}
602602

603603
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]

src/tests/verified_chats.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ async fn test_break_protection_then_verify_again() -> Result<()> {
686686
alice.create_chat(&bob).await;
687687
assert_verified(&alice, &bob, ProtectionStatus::Protected).await;
688688
let chats = Chatlist::try_load(&alice, DC_GCL_FOR_FORWARDING, None, None).await?;
689-
assert!(chats.len() == 1);
689+
assert_eq!(chats.len(), 1);
690690

691691
tcm.section("Bob reinstalls DC");
692692
drop(bob);
@@ -709,7 +709,7 @@ async fn test_break_protection_then_verify_again() -> Result<()> {
709709
assert_eq!(chat.is_protected(), false);
710710
assert_eq!(chat.is_protection_broken(), true);
711711
let chats = Chatlist::try_load(&alice, DC_GCL_FOR_FORWARDING, None, None).await?;
712-
assert!(chats.len() == 1);
712+
assert_eq!(chats.len(), 1);
713713

714714
{
715715
let alice_bob_chat = alice.get_chat(&bob_new).await;

0 commit comments

Comments
 (0)