File: 012l4p.t

package info (click to toggle)
libnet-ssh-authorizedkeysfile-perl 0.18-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 228 kB
  • sloc: perl: 596; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 946 bytes parent folder | download | duplicates (3)
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
35
36
37
38
######################################################################
# Test suite for Net::SSH::AuthorizedKeysFile
# by Mike Schilli <m@perlmeister.com>
######################################################################

use warnings;
use strict;
use File::Temp qw(tempfile);
use FindBin qw( $Bin );
use Test::More;
use Log::Log4perl qw(:easy);
use Net::SSH::AuthorizedKeysFile;

Log::Log4perl->easy_init({level => $ERROR, file => "stdout"});
my $cdir = "$Bin/canned";

my $ak = Net::SSH::AuthorizedKeysFile->new(
    file => "$cdir/ak.txt",
);

my($tmp_fh, $tmp_file) = tempfile( UNLINK => 1 );
use vars qw($OLDOUT);
open(OLDOUT, ">&STDOUT");
open(STDOUT, ">$tmp_file") || die "Can't redirect stdout $tmp_file $!";
select(STDOUT); $| = 1;     # make unbuffered

$ak->read();

close(STDOUT);
open(STDOUT, ">&OLDOUT");

open FILE, "<$tmp_file" or die;
my $data = join "", <FILE>;
close FILE;

is $data, "", "nothing printed";

done_testing;