summaryrefslogtreecommitdiff
path: root/tests/urlutils_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/urlutils_tests.c')
-rw-r--r--tests/urlutils_tests.c15
1 files changed, 15 insertions, 0 deletions
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);
+}