]> granicus.if.org Git - neomutt/commitdiff
Add tests for mutt_addr_cmp
authorPietro Cerutti <gahr@gahr.ch>
Sat, 18 May 2019 16:20:15 +0000 (16:20 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 23 May 2019 10:57:10 +0000 (11:57 +0100)
test/address/mutt_addr_cmp.c

index 4aa2a2b6eef9ee292651cebbf6506e5f37e6dec3..c3420528a03a7c57427b39d7f8c99a36e90dcd83 100644 (file)
@@ -39,4 +39,22 @@ void test_mutt_addr_cmp(void)
     struct Address addr = { 0 };
     TEST_CHECK(!mutt_addr_cmp(&addr, NULL));
   }
+
+  {
+    struct Address a1 = { .mailbox = "test@example.com" };
+    struct Address a2 = { .mailbox = "test@example.com" };
+    TEST_CHECK(mutt_addr_cmp(&a1, &a2));
+  }
+
+  {
+    struct Address a1 = { .mailbox = "test@example.com" };
+    struct Address a2 = { .mailbox = "TEST@example.COM" };
+    TEST_CHECK(mutt_addr_cmp(&a1, &a2));
+  }
+
+  {
+    struct Address a1 = { .mailbox = "test@example.com" };
+    struct Address a2 = { .mailbox = "test@example.com.org" };
+    TEST_CHECK(!mutt_addr_cmp(&a1, &a2));
+  }
 }