Skip to content

Commit 225f518

Browse files
SineSwiperoalders
authored andcommitted
Add unit tests for ssh, sftp, scp
1 parent b6f2e7e commit 225f518

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

t/scp.t

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use strict;
2+
use warnings;
3+
4+
use Test::More tests => 6;
5+
6+
use URI ();
7+
my $uri;
8+
9+
$uri = URI->new("scp://user\@ssh.example.com/path");
10+
11+
is($uri->scheme, 'scp');
12+
is($uri->host, 'ssh.example.com');
13+
is($uri->port, 22);
14+
is($uri->secure, 1);
15+
is($uri->user, 'user');
16+
is($uri->password, undef);

t/sftp.t

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use strict;
2+
use warnings;
3+
4+
use Test::More tests => 6;
5+
6+
use URI ();
7+
my $uri;
8+
9+
$uri = URI->new("sftp://user\@ssh.example.com/path");
10+
11+
is($uri->scheme, 'sftp');
12+
is($uri->host, 'ssh.example.com');
13+
is($uri->port, 22);
14+
is($uri->secure, 1);
15+
is($uri->user, 'user');
16+
is($uri->password, undef);

t/ssh.t

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use strict;
2+
use warnings;
3+
4+
use Test::More tests => 6;
5+
6+
use URI ();
7+
my $uri;
8+
9+
$uri = URI->new("ssh://user\@ssh.example.com/path");
10+
11+
is($uri->scheme, 'ssh');
12+
is($uri->host, 'ssh.example.com');
13+
is($uri->port, 22);
14+
is($uri->secure, 1);
15+
is($uri->user, 'user');
16+
is($uri->password, undef);

0 commit comments

Comments
 (0)