Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b79c3ea7f6
Fetching contributors…

Cannot retrieve contributors at this time

61 lines (43 sloc) 1.819 kb
use v6;
use Test;
plan 28;
use November::URI;
ok(1,'We use URI and we are still alive');
my $u = => '');
is($u.scheme, 'http', 'scheme');
is($, '', 'host');
is($u.port, '80', 'port');
is($u.path, '/about/us', 'path');
is($u.query, 'foo', 'query');
is($u.frag, 'bar', 'frag');
is($u.chunks, 'about us', 'chunks');
is($u.chunks[0], 'about', 'first chunk');
is($u.chunks[1], 'us', 'second chunk');
is( ~$u, '',
'Complete path stringification');
$u = => 'https://eXAMplE.COM');
is($u.scheme, 'https', 'scheme');
is($, '', 'host');
is( "$u", '',
'https://eXAMplE.COM stringifies to');
$u = => '/foo/bar/baz');
is($u.chunks, 'foo bar baz', 'chunks from absolute path');
ok($u.absolute, 'absolute path');
nok($u.relative, 'not relative path');
$u = => 'foo/bar/baz');
is($u.chunks, 'foo bar baz', 'chunks from relative path');
ok( $u.relative, 'relative path');
nok($u.absolute, 'not absolute path');
is($u.chunks[0], 'foo', 'first chunk');
is($u.chunks[1], 'bar', 'second chunk');
is($u.chunks[*-1], 'baz', 'last chunk');
$u = => '');
ok($u.chunks.list.perl eq '[""]', ".chunks return [''] for empty path");
ok($u.absolute, ' has an absolute path');
nok($u.relative, ' does not have a relative path');
# test November::URI parsing with <> or "" and spaces
$u = => "<> ");
is("$u", '', '<> removed from str');
$u = => ' ""');
is("$u", '', '"" removed from str');
# vim:ft=perl6
Jump to Line
Something went wrong with that request. Please try again.