pidgin: df45ef4a: Oh, let's put our original test cases in...
markdoliner at pidgin.im
markdoliner at pidgin.im
Mon Jun 14 18:25:32 EDT 2010
-----------------------------------------------------------------
Revision: df45ef4a7ecbd22816d968415916540e2629c321
Ancestor: d918cdc525638623e1e461b9967485eec5d758ee
Author: markdoliner at pidgin.im
Date: 2010-06-14T22:23:33
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/df45ef4a7ecbd22816d968415916540e2629c321
Modified files:
libpurple/tests/test_util.c
ChangeLog:
Oh, let's put our original test cases in the two arrays, to make things
consistent and good
-------------- next part --------------
============================================================
--- libpurple/tests/test_util.c 4f0635a8b3688980eea70f2fb12af4a7e039499c
+++ libpurple/tests/test_util.c 9c02b76b1af268d52783bbb6912d61d036dfb9b2
@@ -67,10 +67,11 @@ END_TEST
END_TEST
/*
- * Lists of valid and invalid email addresses comes from
+ * Many of the valid and invalid email addresses lised below are from
* http://fightingforalostcause.net/misc/2006/compare-email-regex.php
*/
const char *valid_emails[] = {
+ "purple-devel at lists.sf.net",
"l3tt3rsAndNumb3rs at domain.com",
"has-dash at domain.com",
"hasApostrophe.o'leary at domain.org",
@@ -93,6 +94,13 @@ const char *invalid_emails[] = {
};
const char *invalid_emails[] = {
+ "purple-devel@@lists.sf.net",
+ "purple at devel@lists.sf.net",
+ "purple-devel at list..sf.net",
+ "purple-devel",
+ "purple-devel@",
+ "@lists.sf.net",
+ "totally bogus",
"missingDomain at .com",
"@missingLocal.org",
"missingatSign.net",
@@ -117,16 +125,6 @@ START_TEST(test_util_email_is_valid)
{
size_t i;
- fail_unless(purple_email_is_valid("purple-devel at lists.sf.net"));
- fail_if(purple_email_is_valid("purple-devel@@lists.sf.net"));
- fail_if(purple_email_is_valid("purple at devel@lists.sf.net"));
- fail_if(purple_email_is_valid("purple-devel at list..sf.net"));
- fail_if(purple_email_is_valid("purple-devel"));
- fail_if(purple_email_is_valid("purple-devel@"));
- fail_if(purple_email_is_valid("@lists.sf.net"));
- fail_if(purple_email_is_valid(""));
- fail_if(purple_email_is_valid("totally bogus"));
-
for (i = 0; i < G_N_ELEMENTS(valid_emails); i++)
fail_unless(purple_email_is_valid(valid_emails[i]), "Email address was: %s", valid_emails[i]);
More information about the Commits
mailing list