5 #include "test-helper.h"
7 #define DEBUG_FLAG EMPATHY_DEBUG_TESTS
8 #include <libempathy/empathy-debug.h>
10 #include <libempathy-gtk/empathy-ui-utils.h>
13 test_replace_link (GString *string,
18 g_string_append_c (string, '[');
19 g_string_append_len (string, text, len);
20 g_string_append_c (string, ']');
29 "http://foo.com", "[http://foo.com]",
32 EmpathyStringParser parsers[] =
34 {empathy_string_match_link, test_replace_link},
38 for (i = 0; tests[i] != NULL; i += 2)
42 string = g_string_new (NULL);
43 empathy_string_parser_substr (string, tests[i], -1, parsers);
45 DEBUG ("'%s' => '%s'", tests[i], string->str);
46 g_assert_cmpstr (tests[i + 1], ==, string->str);
48 g_string_free (string, TRUE);
58 test_init (argc, argv);
60 g_test_add_func ("/parsers", test_parsers);
62 result = g_test_run ();