changeset 22197:a67c0aa4db9c

Add a few tets to make sure we're catching some invalid email formats
author Mark Doliner <mark@kingant.net>
date Fri, 25 Jan 2008 01:40:51 +0000
parents 6c7cf4654d10
children a07c5798467f
files libpurple/tests/test_util.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/tests/test_util.c	Fri Jan 25 00:52:40 2008 +0000
+++ b/libpurple/tests/test_util.c	Fri Jan 25 01:40:51 2008 +0000
@@ -71,6 +71,13 @@
 START_TEST(test_util_email_is_valid)
 {
 	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("@lists.sf.net"));
+	fail_if(purple_email_is_valid(""));
+	fail_if(purple_email_is_valid("totally bogus"));
 }
 END_TEST