Skip to content

Commit 71feecf

Browse files
committed
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

Diff for: internal/result/result_test.go

+1-1
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)