File tree 1 file changed +17
-13
lines changed
1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -17,25 +17,29 @@ func BenchmarkGetCommitGraph(b *testing.B) {
17
17
b .Error ("Could not open repository" )
18
18
}
19
19
20
- graph , err := GetCommitGraph (currentRepo )
21
- if err != nil {
22
- b .Error ("Could get commit graph" )
23
- }
24
-
25
- if len (graph ) < 100 {
26
- b .Error ("Should get 100 log lines." )
20
+ for i := 0 ; i < b .N ; i ++ {
21
+ graph , err := GetCommitGraph (currentRepo )
22
+ if err != nil {
23
+ b .Error ("Could get commit graph" )
24
+ }
25
+
26
+ if len (graph ) < 100 {
27
+ b .Error ("Should get 100 log lines." )
28
+ }
27
29
}
28
30
}
29
31
30
32
func BenchmarkParseCommitString (b * testing.B ) {
31
33
testString := "* DATA:||4e61bacab44e9b4730e44a6615d04098dd3a8eaf|2016-12-20 21:10:41 +0100|Kjell Kvinge|[email protected] |4e61bac|Add route for graph"
32
34
33
- graphItem , err := graphItemFromString (testString , nil )
34
- if err != nil {
35
- b .Error ("could not parse teststring" )
36
- }
35
+ for i := 0 ; i < b .N ; i ++ {
36
+ graphItem , err := graphItemFromString (testString , nil )
37
+ if err != nil {
38
+ b .Error ("could not parse teststring" )
39
+ }
37
40
38
- if graphItem .Author != "Kjell Kvinge" {
39
- b .Error ("Did not get expected data" )
41
+ if graphItem .Author != "Kjell Kvinge" {
42
+ b .Error ("Did not get expected data" )
43
+ }
40
44
}
41
45
}
You can’t perform that action at this time.
0 commit comments