#!./perl
BEGIN {
chdir 't' if -d 't';
}
if (!eval "require Socket") {
print "1..0 # no Socket\n"; exit 0;
}
print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
}
}
use strict;
use Cwd;
print "1..20\n";
# for testing _readrc
# avoid "used only once" warning
};
# for testing _readrc
my @stat;
return @stat;
};
# for testing _readrc
(my $libnet_t = __FILE__) =~ s/\w+.t$/libnet_t.pl/;
require $libnet_t;
# now that the tricks are out of the way...
my $warn;
$warn = shift;
};
$stat[2] = 077;
'_readrc() should not read world-writable file' );
'... and should warn about it' );
# the owner field should still not match
$stat[2] = 0;
if ($<) {
'_readrc() should not read file owned by someone else' );
'... and should warn about it' );
} else {
}
}
# this field must now match, to avoid the last-tested warning
$stat[4] = $<;
# this curious mix of spaces and quotes tests a regex at line 79 (version 2.11)
macdef bar
login baz
machine "foo"
login nigol "password" drowssap
machine foo "login" l2
password p2
account tnuocca
default login "baz" password p2
default "login" baz password p3
macdef
LINES
# having set several lines and the uid, this should succeed
# on 'foo', the login is 'nigol'
'lookup() should find value by host name' );
# on 'foo' with login 'l2', the password is 'p2'
'lookup() should find value by hostname and login name' );
# the default password is 'p3', as later declarations have priority
'lookup() should find default value' );
# lookup() ignores the login parameter when using default data
'lookup() should ignore passed login when searching default' );
# lookup() goes to default data if hostname cannot be found in config data
'lookup() should use default for unknown machine name' );
# now test these accessors
}
# and the three-for-one accessor
'lpa() should return login, password, account');
'lpa() should return appropriate values for l, p, and a' );
sub new {
}
sub TIEHANDLE {
}
my @lines;
sub set_lines {
@lines = @_;
}
sub READLINE {
shift @lines;
}
sub close { 1 }