File: 4_perl5_11.t

package info (click to toggle)
libnet-sftp-foreign-perl 1.57%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 552 kB
  • ctags: 362
  • sloc: perl: 4,790; sh: 48; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 554 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
#!/usr/bin/perl

use strict;
use warnings;

use Test::More;

use lib "./t";
use common;

my $server; # = 'localhost';
my $sscmd = sftp_server;

plan skip_all => "tests not supported on inferior OS"
    if (is_windows and eval "no warnings; getlogin ne 'salva'");
plan skip_all => "sftp-server not found"
    unless defined $sscmd;

plan tests => 2;

use Net::SFTP::Foreign;

my $sftp = Net::SFTP::Foreign->new(open2_cmd => $sscmd, timeout => 20);
my $fn = File::Spec->rel2abs('t/data.txd');

ok(my $fh = $sftp->open($fn), "open");
ok (!eof($fh), "eof");