Browse Source

Made parse_headers() return number of them

Alois Mahdal (@azzgoat) 11 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,7 +32,7 @@ sub parse_headers {
32 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,7 +13,8 @@ ok($repo,           "repo is true");
13 13
 my $stm = $repo->load_stm(stm=>'/release/rc.stm');
14 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 18
 &helper::dmupp(stm=>$stm);
18 19
 
19 20
 done_testing();