From 225f51804f8849328a8750cc7c2a2fd2c82cbd2f Mon Sep 17 00:00:00 2001 From: Brendan Byrd Date: Tue, 8 Oct 2024 14:24:44 -0400 Subject: [PATCH] Add unit tests for ssh, sftp, scp --- t/scp.t | 16 ++++++++++++++++ t/sftp.t | 16 ++++++++++++++++ t/ssh.t | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 t/scp.t create mode 100644 t/sftp.t create mode 100644 t/ssh.t diff --git a/t/scp.t b/t/scp.t new file mode 100644 index 0000000..1f810bb --- /dev/null +++ b/t/scp.t @@ -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); diff --git a/t/sftp.t b/t/sftp.t new file mode 100644 index 0000000..b3b37fc --- /dev/null +++ b/t/sftp.t @@ -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); diff --git a/t/ssh.t b/t/ssh.t new file mode 100644 index 0000000..49456ea --- /dev/null +++ b/t/ssh.t @@ -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);