comparison libpurple/tests/test_util.c @ 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 b4593c886933
children 18fb032a602a
comparison
equal deleted inserted replaced
21151:4886667b0686 21152:1dd6704cd187
79 fail_unless(377185800 == purple_str_to_time("19811214T12:50:00", TRUE, NULL, NULL, NULL)); 79 fail_unless(377185800 == purple_str_to_time("19811214T12:50:00", TRUE, NULL, NULL, NULL));
80 fail_unless(1175919261 == purple_str_to_time("20070407T04:14:21", TRUE, NULL, NULL, NULL)); 80 fail_unless(1175919261 == purple_str_to_time("20070407T04:14:21", TRUE, NULL, NULL, NULL));
81 } 81 }
82 END_TEST 82 END_TEST
83 83
84 START_TEST(test_markup_html_to_xhtml)
85 {
86 gchar *xhtml = NULL;
87 gchar *plaintext = NULL;
88 purple_markup_html_to_xhtml("<a>", &xhtml, &plaintext);
89 fail_unless(strcmp("<a href=''></a>", xhtml) == 0, NULL);
90 g_free(xhtml);
91 fail_unless(strcmp("", plaintext) == 0, NULL);
92 g_free(plaintext);
93 }
94 END_TEST
95
84 Suite * 96 Suite *
85 util_suite(void) 97 util_suite(void)
86 { 98 {
87 Suite *s = suite_create("Utility Functions"); 99 Suite *s = suite_create("Utility Functions");
88 100
111 123
112 tc = tcase_create("Time"); 124 tc = tcase_create("Time");
113 tcase_add_test(tc, test_util_str_to_time); 125 tcase_add_test(tc, test_util_str_to_time);
114 suite_add_tcase(s, tc); 126 suite_add_tcase(s, tc);
115 127
128 tc = tcase_create("Markup");
129 tcase_add_test(tc, test_markup_html_to_xhtml);
130 suite_add_tcase(s, tc);
131
116 return s; 132 return s;
117 } 133 }