File: ftp.t

package info (click to toggle)
liburi-perl 5.30-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 948 kB
  • sloc: perl: 3,936; makefile: 4
file content (34 lines) | stat: -rw-r--r-- 803 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use strict;
use warnings;

use Test::More tests => 15;

use URI ();
my $uri;

$uri = URI->new("ftp://ftp.example.com/path");

is($uri->scheme, "ftp");
is($uri->host, "ftp.example.com");
is($uri->port, 21);
is($uri->secure, 0);
is($uri->encrypt_mode, undef);
is($uri->user, "anonymous");
is($uri->password, 'anonymous@');

$uri->userinfo("gisle\@aas.no");

is($uri, "ftp://gisle%40aas.no\@ftp.example.com/path");
is($uri->user, "gisle\@aas.no");
is($uri->password, undef);

$uri->password("secret");

is($uri, "ftp://gisle%40aas.no:secret\@ftp.example.com/path");

$uri = URI->new("ftp://gisle\@aas.no:secret\@ftp.example.com/path");

is($uri, "ftp://gisle\@aas.no:secret\@ftp.example.com/path");
is($uri->userinfo, "gisle\@aas.no:secret");
is($uri->user, "gisle\@aas.no");
is($uri->password, "secret");