From c8512910a23dfedbc307b4f5eb843f4dce65740f Mon Sep 17 00:00:00 2001 From: Antti Ajanki Date: Wed, 7 Aug 2013 11:31:05 +0300 Subject: Handle mailto: URLs --- tests/urlutils_tests.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/urlutils_tests.c') diff --git a/tests/urlutils_tests.c b/tests/urlutils_tests.c index da5f9e1..73e76ff 100644 --- a/tests/urlutils_tests.c +++ b/tests/urlutils_tests.c @@ -29,6 +29,13 @@ void test_url_scheme_invalid_characters() { g_free(prefix); } +void test_url_scheme_mailto() { + gchar *prefix = url_scheme("mailto:john.doe@example.com"); + g_assert(prefix); + g_assert(strcmp(prefix, "mailto") == 0); + g_free(prefix); +} + void test_url_root() { gchar *prefix = url_root("http://example.com/"); g_assert(prefix); @@ -225,3 +232,11 @@ void test_url_rel2abs_scheme() { g_assert(strcmp(abs, "http://server.org/path2/file2") == 0); g_free(abs); } + +void test_url_rel2abs_mailto_scheme() { + gchar *abs = relative_url_to_absolute("http://example.com/index.html", + "mailto:john.doe@example.com"); + g_assert(abs); + g_assert(strcmp(abs, "mailto:john.doe@example.com") == 0); + g_free(abs); +} -- cgit v1.2.3