]> git.0d.be Git - empathy.git/commitdiff
Also parse smileys in tests
authorXavier Claessens <xclaesse@gmail.com>
Tue, 24 Nov 2009 13:37:32 +0000 (14:37 +0100)
committerXavier Claessens <xclaesse@gmail.com>
Tue, 24 Nov 2009 17:29:45 +0000 (18:29 +0100)
tests/empathy-parser-test.c

index e1807251d946f9cca5da9fc99f2813c9634b195a..dce91c72260ee5ca28dc31f50e994509fbf211d4 100644 (file)
@@ -20,6 +20,17 @@ test_replace_link (GString *string,
   g_string_append_c (string, ']');
 }
 
+static void
+test_replace_smiley (GString *string,
+                     const gchar *text,
+                     gssize len,
+                     gpointer user_data)
+{
+  g_string_append_c (string, '<');
+  g_string_append_len (string, text, len);
+  g_string_append_c (string, '>');
+}
+
 static void
 test_parsers (void)
 {
@@ -27,14 +38,17 @@ test_parsers (void)
   gchar *tests[] =
     {
       "http://foo.com", "[http://foo.com]",
+      ":)http://foo.com :D", "<:)>[http://foo.com] <:D>",
       NULL, NULL
     };
   EmpathyStringParser parsers[] =
     {
       {empathy_string_match_link, test_replace_link},
+      {empathy_string_match_smiley, test_replace_smiley},
       {NULL, NULL}
     };
 
+  DEBUG ("Started");
   for (i = 0; tests[i] != NULL; i += 2)
     {
       GString *string;