diff libpurple/tests/test_yahoo_util.c @ 28369:5ff49aa05439

Don't put stuff into a linked list only to iterate through the linked list immediately afterward. Instead, just deal with the three items on the fly. So much simpler.
author Mark Doliner <mark@kingant.net>
date Thu, 20 Aug 2009 02:15:00 +0000
parents b289449f3e9f
children 2a6f0c2460ae
line wrap: on
line diff
--- a/libpurple/tests/test_yahoo_util.c	Thu Aug 20 01:51:37 2009 +0000
+++ b/libpurple/tests/test_yahoo_util.c	Thu Aug 20 02:15:00 2009 +0000
@@ -127,16 +127,6 @@
 	assert_string_equal_free("plain &",
 			yahoo_html_to_codes("plain &amp;"));
 
-	/* link */
-	assert_string_equal_free("http://pidgin.im/",
-			yahoo_html_to_codes("<A HREF=\"http://pidgin.im/\">http://pidgin.im/</A>"));
-	assert_string_equal_free("mark@example.com",
-			yahoo_html_to_codes("<A HREF=\"mailto:mark@example.com\">mark@example.com</A>"));
-#if 0
-	assert_string_equal_free("http://pidgin.im/",
-			yahoo_html_to_codes("<A HREF=\"http://pidgin.im/\">Pidgin</A>"));
-#endif
-
 	/* bold/italic/underline */
 	assert_string_equal_free("\x1B[1mbold\x1B[x1m",
 			yahoo_html_to_codes("<b>bold</b>"));
@@ -153,6 +143,24 @@
 	assert_string_equal_free("\x1B[1mbold \x1B[2mbolditalic\x1B[x2m\x1B[x1m\x1B[2m \x1B[4mitalicunderline\x1B[x4m\x1B[x2m",
 			yahoo_html_to_codes("<b>bold <i>bolditalic</i></b><i> <u>italicunderline</u></i>"));
 
+	/* link */
+	assert_string_equal_free("http://pidgin.im/",
+			yahoo_html_to_codes("<A HREF=\"http://pidgin.im/\">http://pidgin.im/</A>"));
+	assert_string_equal_free("mark@example.com",
+			yahoo_html_to_codes("<A HREF=\"mailto:mark@example.com\">mark@example.com</A>"));
+#if 0
+	assert_string_equal_free("http://pidgin.im/",
+			yahoo_html_to_codes("<A HREF=\"http://pidgin.im/\">Pidgin</A>"));
+#endif
+
+	/* font nothing */
+	assert_string_equal_free("nothing",
+			yahoo_html_to_codes("<font>nothing</font>"));
+
+	/* font color */
+	assert_string_equal_free("\x1B[#E71414mred\x1B[#000000m",
+			yahoo_html_to_codes("<font color=\"#E71414\">red</font>"));
+
 	/* font size */
 	assert_string_equal_free("<font size=\"10\">test</font>",
 			yahoo_html_to_codes("<font size=\"2\">test</font>"));