test read_cnt
[Biblio-Isis] / t / 002_isis.t
index fa8a709..3b93a0a 100755 (executable)
@@ -5,7 +5,7 @@ use blib;
 
 use Data::Dumper;
 
-use Test::More tests => 108;
+use Test::More tests => 110;
 
 BEGIN { use_ok( 'IsisDB' ); }
 
@@ -24,7 +24,9 @@ sub test_data {
        SKIP: {
                skip "no CNT file for this database", 5 unless $isis->{cnt_file};
 
-               $isis->read_cnt;
+               ok(my $isis_cnt = $isis->read_cnt, "read_cnt");
+
+               cmp_ok(scalar keys %{$isis_cnt}, '==', 2, "returns 2 elements");
 
                my $cnt = {
                        '1' => {
@@ -53,7 +55,7 @@ sub test_data {
 
                foreach my $c (keys %{$cnt}) {
                        foreach my $kn (keys %{$cnt->{$c}}) {
-                               cmp_ok($isis->{cnt}->{$c}->{$kn}, '==', $cnt->{$c}->{$kn}, "cnt $c $kn same");
+                               cmp_ok($isis_cnt->{$c}->{$kn}, '==', $cnt->{$c}->{$kn}, "cnt $c $kn same");
                        }
                }
        }