You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since output always has had the same format regardless of the tool configuration, with the configuration only determining
whether or not it will be printed, it made sense to place the printing control logic at the point of printing, always
outputting the message from the result package.
It has now been determined that there are different formatting requirements for verbose and non-verbose output. This
means that it makes more sense to move that logic to the result package and simply return an empty string when no output
should be printed. This refactoring in preparation for the formatting changes to the non-verbose output.
assert.Equal(t, fmt.Sprintf("Rule %s result: %s\n%s: %s\n", ruleConfiguration.ID, ruleresult.NotRun, rulelevel.Notice, ruleOutput), summaryText, "Non-fail result should not use message")
assert.Equal(t, fmt.Sprintf("Rule %s result: %s\n", ruleConfiguration.ID, ruleresult.Pass), summaryText, "Non-failure result with no rule function output should only use preface")
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")
90
+
assert.Equal(t, "", summaryText, "Non-fail result should not result in output in non-verbose mode")
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")
92
+
assert.Equal(t, "", summaryText, "Non-fail result should not result in output in non-verbose mode")
0 commit comments