comparison libpurple/tests/test_yahoo_util.c @ 28110:59d45eb5f9c9

Add a test with a custom color
author Mark Doliner <mark@kingant.net>
date Fri, 31 Jul 2009 09:34:39 +0000
parents 301c966fa7af
children 07de864fc024
comparison
equal deleted inserted replaced
28108:2b3a9a68e0bc 28110:59d45eb5f9c9
16 START_TEST(test_codes_to_html) 16 START_TEST(test_codes_to_html)
17 { 17 {
18 assert_string_equal_free("plain", yahoo_codes_to_html("plain")); 18 assert_string_equal_free("plain", yahoo_codes_to_html("plain"));
19 19
20 /* bold/italic/underline */ 20 /* bold/italic/underline */
21 assert_string_equal_free("<b>bold", yahoo_codes_to_html("\x1B[1mbold")); 21 assert_string_equal_free("<b>bold",
22 assert_string_equal_free("<i>italic", yahoo_codes_to_html("\x1B[2mitalic")); 22 yahoo_codes_to_html("\x1B[1mbold"));
23 assert_string_equal_free("<u>underline", yahoo_codes_to_html("\x1B[4munderline")); 23 assert_string_equal_free("<i>italic",
24 assert_string_equal_free("<b>bold</b> <i>italic</i> <u>underline", yahoo_codes_to_html("\x1B[1mbold\x1B[x1m \x1B[2mitalic\x1B[x2m \x1B[4munderline")); 24 yahoo_codes_to_html("\x1B[2mitalic"));
25 assert_string_equal_free("<u>underline",
26 yahoo_codes_to_html("\x1B[4munderline"));
27 assert_string_equal_free("<b>bold</b> <i>italic</i> <u>underline",
28 yahoo_codes_to_html("\x1B[1mbold\x1B[x1m \x1B[2mitalic\x1B[x2m \x1B[4munderline"));
25 29
26 /* font color and size */ 30 /* font color and size */
27 assert_string_equal_free("<span style=\"color: #0000FF\">blue", yahoo_codes_to_html("\x1B[31mblue")); 31 assert_string_equal_free("<span style=\"color: #0000FF\">blue",
28 assert_string_equal_free("<font size=\"4\" absz=\"15\">test", yahoo_codes_to_html("<font size=\"15\">test")); 32 yahoo_codes_to_html("\x1B[31mblue"));
29 assert_string_equal_free("<span style=\"color: #FF0080\"><font size=\"4\" absz=\"15\">test", yahoo_codes_to_html("\x1B[35m<font size=\"15\">test")); 33 assert_string_equal_free("<span style=\"color: #70ea15\">test",
34 yahoo_codes_to_html("\x1B[#70ea15mtest"));
35 assert_string_equal_free("<font size=\"4\" absz=\"15\">test",
36 yahoo_codes_to_html("<font size=\"15\">test"));
37 assert_string_equal_free("<span style=\"color: #FF0080\"><font size=\"4\" absz=\"15\">test",
38 yahoo_codes_to_html("\x1B[35m<font size=\"15\">test"));
30 } 39 }
31 END_TEST 40 END_TEST
32 41
33 Suite * 42 Suite *
34 yahoo_util_suite(void) 43 yahoo_util_suite(void)