Mercurial > pidgin
changeset 30189:72d9caae4406
Oh, let's put our original test cases in the two arrays, to make things
consistent and good
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 14 Jun 2010 22:23:33 +0000 |
parents | 3a627563ca71 |
children | e4c57ecc54ee b8782b02330d |
files | libpurple/tests/test_util.c |
diffstat | 1 files changed, 9 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/tests/test_util.c Mon Jun 14 22:09:50 2010 +0000 +++ b/libpurple/tests/test_util.c Mon Jun 14 22:23:33 2010 +0000 @@ -67,10 +67,11 @@ 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@lists.sf.net", "l3tt3rsAndNumb3rs@domain.com", "has-dash@domain.com", "hasApostrophe.o'leary@domain.org", @@ -93,6 +94,13 @@ }; const char *invalid_emails[] = { + "purple-devel@@lists.sf.net", + "purple@devel@lists.sf.net", + "purple-devel@list..sf.net", + "purple-devel", + "purple-devel@", + "@lists.sf.net", + "totally bogus", "missingDomain@.com", "@missingLocal.org", "missingatSign.net", @@ -117,16 +125,6 @@ { size_t i; - fail_unless(purple_email_is_valid("purple-devel@lists.sf.net")); - fail_if(purple_email_is_valid("purple-devel@@lists.sf.net")); - fail_if(purple_email_is_valid("purple@devel@lists.sf.net")); - fail_if(purple_email_is_valid("purple-devel@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]);