]> mj.ucw.cz Git - libucw.git/blob - ucw/url.t
Opt: opt_failure() is public, opt_usage() not so
[libucw.git] / ucw / url.t
1 # Tests for url.c
2
3 Name:   Absolute
4 Run:    ../obj/ucw/url-t 'ftp://example.com/other'
5 Out:    deesc: ftp://example.com/other
6         split: @ftp@(null)@(null)@example.com@-1@/other
7         base: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/index.html;param?query&zzz/sub;query+#fragment?
8         normalize: @ftp@(null)@(null)@example.com@21@/other
9         canonicalize: @ftp@(null)@(null)@example.com@21@/other
10         pack: ftp://example.com/other
11         enesc: ftp://example.com/other
12
13 Name:   Simple
14 Run:    ../obj/ucw/url-t 'object'
15 Out:    deesc: object
16         split: @(null)@(null)@(null)@(null)@-1@object
17         base: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/index.html;param?query&zzz/sub;query+#fragment?
18         normalize: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/object
19         canonicalize: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/object
20         pack: http://mj@www.hell.org/123/sub_dir;param/object
21         enesc: http://mj@www.hell.org/123/sub_dir;param/object
22
23 Name:   Toplevel
24 Run:    ../obj/ucw/url-t '/object'
25 Out:    deesc: /object
26         split: @(null)@(null)@(null)@(null)@-1@/object
27         base: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/index.html;param?query&zzz/sub;query+#fragment?
28         normalize: @http@mj@(null)@www.hell.org@80@/object
29         canonicalize: @http@mj@(null)@www.hell.org@80@/object
30         pack: http://mj@www.hell.org/object
31         enesc: http://mj@www.hell.org/object
32
33 Name:   Domain
34 Run:    ../obj/ucw/url-t '//www.example.com'
35 Out:    deesc: //www.example.com
36         split: @(null)@(null)@(null)@www.example.com@-1@
37         base: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/index.html;param?query&zzz/sub;query+#fragment?
38         normalize: @http@(null)@(null)@www.example.com@80@
39         canonicalize: @http@(null)@(null)@www.example.com@80@/
40         pack: http://www.example.com/
41         enesc: http://www.example.com/
42
43 Name:   Levels
44 Run:    ../obj/ucw/url-t '../a/b;paramb/c/.././x?a#frag'
45 Out:    deesc: ../a/b;paramb/c/.././x?a#frag
46         split: @(null)@(null)@(null)@(null)@-1@../a/b;paramb/c/.././x?a#frag
47         base: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/index.html;param?query&zzz/sub;query+#fragment?
48         normalize: @http@mj@(null)@www.hell.org@80@/123/a/b;paramb/x?a#frag
49         canonicalize: @http@mj@(null)@www.hell.org@80@/123/a/b;paramb/x?a
50         pack: http://mj@www.hell.org/123/a/b;paramb/x?a
51         enesc: http://mj@www.hell.org/123/a/b;paramb/x?a
52
53 Name:   Query
54 Run:    ../obj/ucw/url-t '?query'
55 Out:    deesc: ?query
56         split: @(null)@(null)@(null)@(null)@-1@?query
57         base: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/index.html;param?query&zzz/sub;query+#fragment?
58         normalize: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/index.html;param?query
59         canonicalize: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/index.html;param?query
60         pack: http://mj@www.hell.org/123/sub_dir;param/index.html;param?query
61         enesc: http://mj@www.hell.org/123/sub_dir;param/index.html;param?query
62
63 Name:   Fragments
64 Run:    ../obj/ucw/url-t '#../?a' 'http://example.com/?query#@?/x'
65 Out:    deesc: #../?a
66         split: @(null)@(null)@(null)@(null)@-1@#../?a
67         base: @http@(null)@(null)@example.com@80@/?query#@?/x
68         normalize: @http@(null)@(null)@example.com@80@/?query#../?a
69         canonicalize: @http@(null)@(null)@example.com@80@/?query
70         pack: http://example.com/?query
71         enesc: http://example.com/?query
72
73 Name:   Deescape
74 Run:    ../obj/ucw/url-t '/%20%25'
75 Out:    deesc: / %
76         split: @(null)@(null)@(null)@(null)@-1@/ %
77         base: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/index.html;param?query&zzz/sub;query+#fragment?
78         normalize: @http@mj@(null)@www.hell.org@80@/ %
79         canonicalize: @http@mj@(null)@www.hell.org@80@/ %
80         pack: http://mj@www.hell.org/ %
81         enesc: http://mj@www.hell.org/%20%25
82
83 Name:   Dots
84 Run:    ../obj/ucw/url-t '..a/./x.?a/x'
85 Out:    deesc: ..a/./x.?a/x
86         split: @(null)@(null)@(null)@(null)@-1@..a/./x.?a/x
87         base: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/index.html;param?query&zzz/sub;query+#fragment?
88         normalize: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/..a/x.?a/x
89         canonicalize: @http@mj@(null)@www.hell.org@80@/123/sub_dir;param/..a/x.?a/x
90         pack: http://mj@www.hell.org/123/sub_dir;param/..a/x.?a/x
91         enesc: http://mj@www.hell.org/123/sub_dir;param/..a/x.?a/x