File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +20
-5
lines changed
Original file line number Diff line number Diff line change 1
1
# [ Codecov] ( https://codecov.io ) Go Example
2
+
3
+ [ ![ codecov] ( https://codecov.io/gh/codecov/example-go/branch/master/graph/badge.svg )] ( https://codecov.io/gh/codecov/example-go )
4
+ [ ![ Build Status] ( https://travis-ci.org/codecov/example-go.svg?branch=master )] ( https://travis-ci.org/codecov/example-go )
2
5
[ ![ FOSSA Status] ( https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fexample-go.svg?type=shield )] ( https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-go?ref=badge_shield )
3
6
4
7
> Note: use ` -covermode=atomic ` or ` -covermode=count ` to show how many times a statement was executed.
@@ -61,4 +64,4 @@ Repository tokens are required for (a) all private repos, (b) public repos not u
61
64
62
65
63
66
# # License
64
- [](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-go?ref=badge_large)
67
+ [](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-go?ref=badge_large)
Original file line number Diff line number Diff line change @@ -5,19 +5,29 @@ import "github.com/codecov/example-go/awesome"
5
5
var result string
6
6
7
7
func Setup () {
8
-
9
8
// Comment
10
-
11
9
result = awesome .Smile ()
12
10
13
11
}
14
12
15
13
func GetResult () string {
16
-
17
14
/*
18
15
Comment
19
16
*/
20
-
21
17
return result
18
+ }
22
19
20
+ func UncoveredTest () int {
21
+ x := 1
22
+ x = x + 1
23
+ return x
23
24
}
25
+
26
+ func CoveredTest (num int ) int {
27
+ x := num + num
28
+ return x
29
+ }
30
+
31
+ func UncoveredSimpleTest () int { return 0 }
32
+
33
+ func CoveredSimpleTest () int { return 1 }
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ var _ = Describe("Example", func() {
11
11
It ("should result :)" , func () {
12
12
Setup ()
13
13
Expect (GetResult ()).To (Equal (":)" ))
14
+ Expect (CoveredTest (1 )).To (Equal (2 ))
15
+ Expect (CoveredSimpleTest ()).To (Equal (1 ))
14
16
})
15
17
})
16
18
})
You can’t perform that action at this time.
0 commit comments