aboutsummaryrefslogtreecommitdiffstats
path: root/camel/tests
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2003-03-27 23:37:47 +0800
committerDan Winship <danw@src.gnome.org>2003-03-27 23:37:47 +0800
commitbe9db81541bff178c5087a47becd5afc519afcb6 (patch)
treef9e15fc56ece03566b03b4d35d74b5fbbd4ba0bd /camel/tests
parentb3293f0d99b13c1ee49f3605534ee3552cf19158 (diff)
downloadgsoc2013-evolution-be9db81541bff178c5087a47becd5afc519afcb6.tar.gz
gsoc2013-evolution-be9db81541bff178c5087a47becd5afc519afcb6.tar.zst
gsoc2013-evolution-be9db81541bff178c5087a47becd5afc519afcb6.zip
Like camel_url_encode, but works directly on an existing GString.
* camel-url.c (append_url_encoded): Like camel_url_encode, but works directly on an existing GString. (camel_url_to_string, output_param): Use it. (camel_url_encode): Likewise. Remove "escape_unsafe" arg since the "unsafe" chars are the ones that should *always* be escaped, and the places we were passing FALSE were wrong. (camel_url_decode): replace with a new version * camel-file-utils.c (camel_file_util_safe_filename): Remove extra arg to camel_url_encode. * tests/misc/url.c (main): Add tests of basic URL parsing and unparsing svn path=/trunk/; revision=20545
Diffstat (limited to 'camel/tests')
-rw-r--r--camel/tests/misc/.cvsignore4
-rw-r--r--camel/tests/misc/url.c19
2 files changed, 20 insertions, 3 deletions
diff --git a/camel/tests/misc/.cvsignore b/camel/tests/misc/.cvsignore
index 7ef94ab5fa..fbb8316a8b 100644
--- a/camel/tests/misc/.cvsignore
+++ b/camel/tests/misc/.cvsignore
@@ -9,4 +9,6 @@ Makefile.in
*.bbg
*.da
*.gcov
-url \ No newline at end of file
+split
+url
+utf7 \ No newline at end of file
diff --git a/camel/tests/misc/url.c b/camel/tests/misc/url.c
index adc6278bae..c2db806621 100644
--- a/camel/tests/misc/url.c
+++ b/camel/tests/misc/url.c
@@ -52,7 +52,22 @@ struct {
{ "g/./h", "http://a/b/c/g/h" },
{ "g/../h", "http://a/b/c/h" },
{ "http:g", "http:g" },
- { "http:", "http:" }
+ { "http:", "http:" },
+
+ /* (not from rfc 1808) */
+ { "sendmail:", "sendmail:" },
+ { "mbox:/var/mail/user", "mbox:/var/mail/user" },
+ { "pop://user@host", "pop://user@host" },
+ { "pop://user@host:99", "pop://user@host:99" },
+ { "pop://user:password@host", "pop://user:password@host" },
+ { "pop://user:password@host:99", "pop://user:password@host:99" },
+ { "pop://user;auth=APOP@host", "pop://user;auth=APOP@host" },
+ { "pop://user@host/;keep_on_server", "pop://user@host/;keep_on_server" },
+ { "pop://user@host/;keep_on_server=1", "pop://user@host/;keep_on_server=1" },
+ { "pop://us%65r@host", "pop://user@host" },
+ { "pop://us%40r@host", "pop://us%40r@host" },
+ { "pop://us%3ar@host", "pop://us%3ar@host" },
+ { "pop://us%2fr@host", "pop://us%2fr@host" }
};
int num_tests = sizeof (tests) / sizeof (tests[0]);
@@ -66,7 +81,7 @@ main (int argc, char **argv)
camel_test_init (argc, argv);
- camel_test_start ("RFC1808 relative URL parsing");
+ camel_test_start ("URL parsing");
camel_test_push ("base URL parsing");
camel_exception_init (&ex);