69
74
{ "<tt>Testing tag</tt>", "Testing tag" },
70
75
{ "<html>Surrounded by html</html>", "Surrounded by html" },
71
76
{ "<qt>Surrounded by qt</qt>", "Surrounded by qt" },
72
{ "First line <br dumb> \r \n Second line", "First line Second line" },
73
{ "First line\n<br /> <br>\n2nd line\r\n3rd line", "First line 2nd line 3rd line" },
77
{ "First line <br dumb> \r \n Second line", "First line\nSecond line" },
78
{ "First line\n<br /> <br>\n2nd line\r\n3rd line", "First line\n2nd line\n3rd line" },
106
test_extract_point_size ()
108
static const IntegerExtraction tests[] = {
111
{ "Bla Fasel -12.0", 0 },
114
{ "Bitstream Vera Serif Italic 1", 1 },
115
{ "Calibri Italic 100", 100 },
116
{ "Century Schoolbook L Italic 42", 42 },
120
for (int i = 0; tests[i].before != NULL; i++)
122
guint extracted = extract_point_size (tests[i].before);
123
g_assert_cmpuint (extracted, ==, tests[i].expected);
128
test_extract_font_face ()
130
static const TextComparisons tests[] = {
132
{ "Sans 10", "Sans " },
133
{ "Candara 9", "Candara " },
134
{ "Bitstream Vera Serif Italic 1", "Bitstream Vera Serif Italic " },
135
{ "Calibri Italic 100", "Calibri Italic " },
136
{ "Century Schoolbook L Italic 10", "Century Schoolbook L Italic " },
140
for (int i = 0; tests[i].before != NULL; i++)
142
GString* filtered = extract_font_face (tests[i].before);
143
g_assert_cmpstr (filtered->str, ==, tests[i].expected);
144
g_string_free (filtered, TRUE);
101
149
test_filtering_create_test_suite (void)
109
157
g_test_suite_add(ts, TC(test_text_filter));
110
158
g_test_suite_add(ts, TC(test_newline_to_space));
159
g_test_suite_add(ts, TC(test_extract_point_size));
160
g_test_suite_add(ts, TC(test_extract_font_face));