Browse Source

Made parse_headers() return number of them

Alois Mahdal (@azzgoat) 12 years ago
parent
commit
7bfacc9117
2 changed files with 3 additions and 2 deletions
  1. 1
    1
      lib/SugarTrail/STM.pm
  2. 2
    1
      t/Repo.t

+ 1
- 1
lib/SugarTrail/STM.pm View File

32
         $self->{meta}->{$n} = $v;
32
         $self->{meta}->{$n} = $v;
33
     }
33
     }
34
 
34
 
35
-    return 1;
35
+    return scalar keys %{ $self->{meta} };
36
 }
36
 }
37
 
37
 
38
 
38
 

+ 2
- 1
t/Repo.t View File

13
 my $stm = $repo->load_stm(stm=>'/release/rc.stm');
13
 my $stm = $repo->load_stm(stm=>'/release/rc.stm');
14
 ok($stm,            "stm is true");
14
 ok($stm,            "stm is true");
15
 
15
 
16
-ok($stm->parse_headers(), "parse_headers() returns true");
16
+ok($stm->parse_headers(), "parse_headers() returns 6");
17
+ok($stm->parse_headers(), "parse_headers() still returns 6");
17
 &helper::dmupp(stm=>$stm);
18
 &helper::dmupp(stm=>$stm);
18
 
19
 
19
 done_testing();
20
 done_testing();