Skip to content

Commit

Permalink
Add unit tests for ssh, sftp, scp
Browse files Browse the repository at this point in the history
  • Loading branch information
SineSwiper authored and oalders committed Oct 8, 2024
1 parent b6f2e7e commit 225f518
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
16 changes: 16 additions & 0 deletions t/scp.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use strict;
use warnings;

use Test::More tests => 6;

use URI ();
my $uri;

$uri = URI->new("scp://user\@ssh.example.com/path");

is($uri->scheme, 'scp');
is($uri->host, 'ssh.example.com');
is($uri->port, 22);
is($uri->secure, 1);
is($uri->user, 'user');
is($uri->password, undef);
16 changes: 16 additions & 0 deletions t/sftp.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use strict;
use warnings;

use Test::More tests => 6;

use URI ();
my $uri;

$uri = URI->new("sftp://user\@ssh.example.com/path");

is($uri->scheme, 'sftp');
is($uri->host, 'ssh.example.com');
is($uri->port, 22);
is($uri->secure, 1);
is($uri->user, 'user');
is($uri->password, undef);
16 changes: 16 additions & 0 deletions t/ssh.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use strict;
use warnings;

use Test::More tests => 6;

use URI ();
my $uri;

$uri = URI->new("ssh://user\@ssh.example.com/path");

is($uri->scheme, 'ssh');
is($uri->host, 'ssh.example.com');
is($uri->port, 22);
is($uri->secure, 1);
is($uri->user, 'user');
is($uri->password, undef);

0 comments on commit 225f518

Please sign in to comment.