From 8b8e9567d5a5d44bbb565013e1b7856f21ab1c5f Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 8 Jun 2010 16:46:05 +0200 Subject: empathy-parser-test: use empathy_string_replace_escaped --- tests/empathy-parser-test.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'tests/empathy-parser-test.c') diff --git a/tests/empathy-parser-test.c b/tests/empathy-parser-test.c index e767852fd..8e4c15a66 100644 --- a/tests/empathy-parser-test.c +++ b/tests/empathy-parser-test.c @@ -24,17 +24,6 @@ test_replace_match (const gchar *text, g_string_append_c (string, ']'); } -static void -test_replace_verbatim (const gchar *text, - gssize len, - gpointer match_data, - gpointer user_data) -{ - GString *string = user_data; - - g_string_append_len (string, text, len); -} - static void test_parsers (void) { @@ -70,20 +59,20 @@ test_parsers (void) "Foo (www.foo.com)", "Foo ([www.foo.com])", "Foo {www.foo.com}", "Foo {[www.foo.com]}", "Foo [www.foo.com]", "Foo [[www.foo.com]]", - "Foo ", "Foo <[www.foo.com]>", - "Foo \"www.foo.com\"", "Foo \"[www.foo.com]\"", + "Foo ", "Foo <[www.foo.com]>", + "Foo \"www.foo.com\"", "Foo "[www.foo.com]"", "Foo (www.foo.com/bar(123)baz)", "Foo ([www.foo.com/bar(123)baz])", - "bar", "bar", + "bar", "<a href="[http://foo.com]">bar</a>", "Foo (user@server.com)", "Foo ([user@server.com])", "Foo {user@server.com}", "Foo {[user@server.com]}", "Foo [user@server.com]", "Foo [[user@server.com]]", - "Foo ", "Foo <[user@server.com]>", - "Foo \"user@server.com\"", "Foo \"[user@server.com]\"", + "Foo ", "Foo <[user@server.com]>", + "Foo \"user@server.com\"", "Foo "[user@server.com]"", /* Basic smileys */ "a:)b", "a[:)]b", ">:)", "[>:)]", - ">:(", ">[:(]", + ">:(", ">[:(]", /* Smileys and links mixed */ ":)http://foo.com", "[:)][http://foo.com]", @@ -102,7 +91,7 @@ test_parsers (void) { {empathy_string_match_link, test_replace_match}, {empathy_string_match_smiley, test_replace_match}, - {empathy_string_match_all, test_replace_verbatim}, + {empathy_string_match_all, empathy_string_replace_escaped}, {NULL, NULL} }; guint i; -- cgit v1.2.3