From 3348a3879bfc80800746c7d4c4b5fea8111b48a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 30 Jan 2010 18:34:06 +0200 Subject: [PATCH] Test cases for make_path() --- src/test/url.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/url.c b/src/test/url.c index f4b665138d..f5df985fab 100644 --- a/src/test/url.c +++ b/src/test/url.c @@ -144,5 +144,19 @@ int main (void) /*val = fchdir (fd); assert (val != -1);*/ + /* URI to path tests */ +#define test( a, b ) test (make_path, a, b) + test ("mailto:john@example.com", NULL); + test ("http://www.example.com/file.html#ref", NULL); + test ("file://", NULL); + test ("file:///", "/"); + test ("file://localhost/home/john/music%2Eogg", "/home/john/music.ogg"); + test ("file://localhost/home/john/text#ref", "/home/john/text"); + test ("fd://0foobar", NULL); + test ("fd://0#ref", "/dev/stdin"); + test ("fd://1", "/dev/stdout"); + test ("fd://12345", "/dev/fd/12345"); +#undef test + return 0; } -- 2.39.2