changeset 21152:1dd6704cd187

Add a test for the html markup parsing to try to prevent a repeat of 2.2.2
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 08 Nov 2007 02:37:02 +0000
parents 4886667b0686
children dada0e6416cc
files libpurple/tests/test_util.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/tests/test_util.c	Tue Nov 06 16:46:04 2007 +0000
+++ b/libpurple/tests/test_util.c	Thu Nov 08 02:37:02 2007 +0000
@@ -81,6 +81,18 @@
 }
 END_TEST
 
+START_TEST(test_markup_html_to_xhtml)
+{
+	gchar *xhtml = NULL;
+	gchar *plaintext = NULL;
+	purple_markup_html_to_xhtml("<a>", &xhtml, &plaintext);
+	fail_unless(strcmp("<a href=''></a>", xhtml) == 0, NULL);
+	g_free(xhtml);
+	fail_unless(strcmp("", plaintext) == 0, NULL);
+	g_free(plaintext);
+}
+END_TEST
+
 Suite *
 util_suite(void)
 {
@@ -113,5 +125,9 @@
 	tcase_add_test(tc, test_util_str_to_time);
 	suite_add_tcase(s, tc);
 
+	tc = tcase_create("Markup");
+	tcase_add_test(tc, test_markup_html_to_xhtml);
+	suite_add_tcase(s, tc);
+
 	return s;
 }