Add test coverage test
This commit is contained in:
parent
9ea0aaae09
commit
9a7515b327
|
@ -125,6 +125,7 @@ t/05-rest-api.t
|
||||||
t/06-rest-api.t
|
t/06-rest-api.t
|
||||||
t/10-save-unchanged-conf.t
|
t/10-save-unchanged-conf.t
|
||||||
t/12-save-changed-conf.t
|
t/12-save-changed-conf.t
|
||||||
|
t/20-test-coverage.t
|
||||||
t/40-sessions.t
|
t/40-sessions.t
|
||||||
t/50-notifications.t
|
t/50-notifications.t
|
||||||
t/90-translations.t
|
t/90-translations.t
|
||||||
|
|
38
lemonldap-ng-manager/t/20-test-coverage.t
Normal file
38
lemonldap-ng-manager/t/20-test-coverage.t
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env perl -I pl/lib
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
use strict;
|
||||||
|
use Lemonldap::NG::Manager::Constants;
|
||||||
|
|
||||||
|
use_ok('Lemonldap::NG::Manager::Build::Attributes');
|
||||||
|
my $count = 1;
|
||||||
|
|
||||||
|
my ( $attrs, $types );
|
||||||
|
ok( $attrs = Lemonldap::NG::Manager::Build::Attributes::attributes(),
|
||||||
|
'Get attributes' );
|
||||||
|
ok( $types = Lemonldap::NG::Manager::Build::Attributes::types(), 'Get types' );
|
||||||
|
$count += 2;
|
||||||
|
|
||||||
|
foreach my $attr ( keys %$attrs ) {
|
||||||
|
ok(
|
||||||
|
(
|
||||||
|
ref( $attrs->{$attr}->{test} )
|
||||||
|
or ref( $types->{ $attrs->{$attr}->{type} }->{test} )
|
||||||
|
or $attrs->{$attr}->{type} =~ /Container$/
|
||||||
|
),
|
||||||
|
"Test exists for $attr"
|
||||||
|
);
|
||||||
|
$count++;
|
||||||
|
if ( $attr =~ qr/^$simpleHashKeys$/o ) {
|
||||||
|
ok(
|
||||||
|
(
|
||||||
|
ref $attrs->{$attr}->{keyTest}
|
||||||
|
or ref $types->{ $attrs->{$attr}->{type} }->{keyTest}
|
||||||
|
),
|
||||||
|
"Key test for $attr"
|
||||||
|
);
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
done_testing($count);
|
Loading…
Reference in New Issue
Block a user