Skip to content

Commit

Permalink
Add code to be covered by test
Browse files Browse the repository at this point in the history
To output valid coverage report
  • Loading branch information
at-wat authored and Sean-Der committed Apr 9, 2024
1 parent 977df1e commit 091e239
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package sandbox

import (
"errors"
"log"

_ "github.com/pion/transport/v3/test" // nolint
)
Expand All @@ -17,3 +18,15 @@ var ErrDummy = errors.New("dummy")
type PublicAPI struct {
PublicMember int
}

// PublicFunc is a dummy public method.
func (p *PublicAPI) PublicFunc() {
log.Println("Running PublicAPI.PublicFunc") // nolint:forbidigo
log.Println("PublicAPI.PublicMember: ", p.PublicMember) // nolint:forbidigo
if p.PublicMember == 1 {
log.Println("PublicAPI.PublicMember is one") // nolint:forbidigo
}
if p.PublicMember != 1 {
log.Println("PublicAPI.PublicMember is not one") // nolint:forbidigo
}
}
2 changes: 2 additions & 0 deletions dummy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ import (
)

func TestDummy(*testing.T) {
p := &PublicAPI{}
p.PublicFunc()
}

0 comments on commit 091e239

Please sign in to comment.