Skip to content

Commit

Permalink
Merge fb9b5cd into 8fd1d7b
Browse files Browse the repository at this point in the history
  • Loading branch information
mcubik committed Aug 26, 2018
2 parents 8fd1d7b + fb9b5cd commit ac1a328
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,33 @@ func TestDefaultConfigWhenFileMissing(t *testing.T) {
func TestThreshold(t *testing.T) {
assert := assert.New(t)
summary := report.Summary{BlockCoverage: 79.9, StmtCoverage: 82.3}
res, err := checkThreshold(80, summary, "block")
passed, err := checkThreshold(80, summary, "block")
assert.NoError(err)
assert.False(res)
assert.False(passed)

res, err = checkThreshold(79, summary, "block")
passed, err = checkThreshold(79, summary, "block")
assert.NoError(err)
assert.True(res)
assert.True(passed)

res, err = checkThreshold(79.9, summary, "block")
passed, err = checkThreshold(79.9, summary, "block")
assert.NoError(err)
assert.True(res)
assert.True(passed)

res, err = checkThreshold(82, summary, "stmt")
passed, err = checkThreshold(82, summary, "stmt")
assert.NoError(err)
assert.True(res)
assert.True(passed)

}

func TestNoThreshold(t *testing.T) {
assert := assert.New(t)
summary := report.Summary{BlockCoverage: 79.9, StmtCoverage: 82.3}
res, err := checkThreshold(0, summary, "block")
passed, err := checkThreshold(0, summary, "block")
assert.NoError(err)
assert.True(res)
assert.True(passed)
}

func TestInvalidTresholdType(t *testing.T) {
func TestInvalidMetric(t *testing.T) {
assert := assert.New(t)
summary := report.Summary{BlockCoverage: 79.9, StmtCoverage: 82.3}
_, err := checkThreshold(80, summary, "xxxx")
Expand Down

0 comments on commit ac1a328

Please sign in to comment.