Skip to content

Commit

Permalink
Update README to highlight the condition coverage mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rillig committed Aug 20, 2023
1 parent b6f3e9a commit d8e747b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

# GOBCO - Golang Branch Coverage

Gobco measures branch coverage of Go code.
Gobco measures condition coverage of Go code.

Gobco should be used in addition to `go test -cover`,
rather than replacing it.
Gobco is intended to be used in addition to `go test -cover`.
For example, gobco does not detect functions or methods that are completely
unused, it only notices them if they contain any conditions or branches.
Gobco also doesn't cover `select` statements.
Expand Down Expand Up @@ -55,9 +54,9 @@ vartypecheck.go:1615:6: condition "distname.IsConstant()" was 8 times true but n

## Adding custom test conditions

If you want to ensure that a certain condition in your code is covered by the
tests, you can insert the desired condition into the code and just assign it
to the underscore:
If you want to ensure that the tests cover a certain condition in your code,
you can insert the desired condition into the code
and assign it to the underscore:

~~~go
func square(x int) int {
Expand Down

0 comments on commit d8e747b

Please sign in to comment.