Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,36 +1,28 @@ | |||
use Test::More tests => 1; | use Test::More tests => 2; | ||
|
|
||
use Net::LDAP::SimpleServer::LDIFStore; | use Net::LDAP::SimpleServer::LDIFStore; | ||
|
|
||
sub _check_param { | sub _check_param { | ||
my @p = @_; | my @p = @_; | ||
eval { my $o = Net::LDAP::SimpleServer::LDIFStore->new(@p); }; | eval { my $o = Net::LDAP::SimpleServer::LDIFStore->new(@p); }; | ||
return $@; | |||
} | } | ||
|
|
||
sub check_param_success { | sub check_param_success { | ||
my $p = _check_param(@_); | my $p = _check_param(@_); | ||
ok($p); | ok( not $p ); | ||
} | } | ||
|
|
||
sub check_param_failure { | sub check_param_failure { | ||
my $p = _check_param(@_); | my $p = _check_param(@_); | ||
ok( not $p ); | ok($p); | ||
} | } | ||
|
|
||
diag("Testing parameters for the constructor\n"); | diag("Testing the constructor params for LDIFStore\n"); | ||
|
|
||
check_param_failure('name/of/a/file/that/will/never/ever/exist.ldif'); | my $obj = undef; | ||
|
|
||
#if ( -r $cfgfile ) { | #$obj = new_ok( 'Net::LDAP::SimpleServer::LDIFStore', [ 'name/of/a/file/that/will/never/ever/exist.ldif' ] ); | ||
# diag( "Using default cfg file: " . $cfgfile ); | check_param_failure('name/of/a/file/that/will/never/ever/exist.ldif'); | ||
# check_param_success(); | $obj = new_ok( 'Net::LDAP::SimpleServer::LDIFStore', ['examples/test1.ldif'] ); | ||
#} | |||
#else { | |||
# diag("Default cfg file not found"); | |||
# check_param_failure(); | |||
#} | |||
|
|||
#SKIP: { | |||
# skip "Not messing with your default configuration file", 1 | |||
# if -r $cfgfile; | |||
|
|