Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 45 lines (35 sloc) 1.43 kb
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
1 use v6;
2 use Test;
eb83019 Fixed test count in rfc-3986-examples.t
U-ron-PC\ron authored
3 plan 22;
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
4
5 use URI;
6854c4a ronaldxs New branch including upgrade to 00 interface. Now "new" method can pars...
ronaldxs authored
6 my $u = URI.new('ftp://ftp.is.co.za/rfc/rfc1808.txt');
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
7 is($u.scheme, 'ftp', 'ftp scheme');
6854c4a ronaldxs New branch including upgrade to 00 interface. Now "new" method can pars...
ronaldxs authored
8 is($u.host, 'ftp.is.co.za', 'ftp host');
9 is($u.path, '/rfc/rfc1808.txt', 'ftp path');
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
10
6854c4a ronaldxs New branch including upgrade to 00 interface. Now "new" method can pars...
ronaldxs authored
11 $u.parse('http://www.ietf.org/rfc/rfc2396.txt');
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
12 is($u.scheme, 'http', 'http scheme');
13 is($u.host, 'www.ietf.org', 'http host');
14 is($u.path, '/rfc/rfc2396.txt', 'http path');
15
6854c4a ronaldxs New branch including upgrade to 00 interface. Now "new" method can pars...
ronaldxs authored
16 $u.parse('ldap://[2001:db8::7]/c=GB?objectClass?one');
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
17 is($u.scheme, 'ldap', 'ldap scheme');
18 is($u.host, '[2001:db8::7]', 'ldap host');
19 is($u.path, '/c=gb', 'ldap path');
20 is($u.query, 'objectClass?one', 'ldap query');
21
6854c4a ronaldxs New branch including upgrade to 00 interface. Now "new" method can pars...
ronaldxs authored
22 $u.parse('mailto:John.Doe@example.com');
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
23 is($u.scheme, 'mailto', 'mailto scheme');
24 is($u.path, 'john.doe@example.com', 'news path');
25
6854c4a ronaldxs New branch including upgrade to 00 interface. Now "new" method can pars...
ronaldxs authored
26 $u.parse('news:comp.infosystems.www.servers.unix');
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
27 is($u.scheme, 'news', 'news scheme');
28 is($u.path, 'comp.infosystems.www.servers.unix', 'news path');
29
6854c4a ronaldxs New branch including upgrade to 00 interface. Now "new" method can pars...
ronaldxs authored
30 $u.parse('tel:+1-816-555-1212');
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
31 is($u.scheme, 'tel', 'telephone scheme');
32 is($u.path, '+1-816-555-1212', 'telephone path');
33
6854c4a ronaldxs New branch including upgrade to 00 interface. Now "new" method can pars...
ronaldxs authored
34 $u.parse('telnet://192.0.2.16:80/');
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
35 is($u.scheme, 'telnet', 'telnet scheme');
36 is($u.authority, '192.0.2.16:80', 'telnet authority');
37 is($u.host, '192.0.2.16', 'telnet host');
38 is($u.port, '80', 'telnet port');
39
6854c4a ronaldxs New branch including upgrade to 00 interface. Now "new" method can pars...
ronaldxs authored
40 $u.parse('urn:oasis:names:specification:docbook:dtd:xml:4.1.2');
e2fb82d Added new test suite based on examples in RFC 3986 and fixed parser fail...
U-ron-PC\ron authored
41 is($u.scheme, 'urn', 'urn scheme');
42 is($u.path, 'oasis:names:specification:docbook:dtd:xml:4.1.2', 'urn path');
43
44 # vim:ft=perl6
Something went wrong with that request. Please try again.