Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 71feecf

Browse files
committedJul 19, 2021
Fix bug in unit test for result.Record() output
An error in the assertion arguments resulted in it providing meaningless results. This also masked the fact that its intended assertion was outdated.
1 parent 8277f9e commit 71feecf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎internal/result/result_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func TestRecord(t *testing.T) {
7979
summaryText = results.Record(lintedProject, ruleConfiguration, ruleresult.NotRun, ruleOutput)
8080
assert.Equal(t, fmt.Sprintf("Rule %s result: %s\n%s: %s", ruleConfiguration.ID, ruleresult.NotRun, rulelevel.Notice, ruleOutput), summaryText, "Non-fail result should not use message")
8181
summaryText = results.Record(lintedProject, ruleConfiguration, ruleresult.Pass, "")
82-
assert.Equal(t, "", "", summaryText, "Non-failure result with no rule function output should result in an empty summary")
82+
assert.Equal(t, fmt.Sprintf("Rule %s result: %s", ruleConfiguration.ID, ruleresult.Pass), summaryText, "Non-failure result with no rule function output should only use preface")
8383

8484
flags.Set("verbose", "true")
8585
require.Nil(t, configuration.Initialize(flags, projectPaths))

0 commit comments

Comments
 (0)
Please sign in to comment.