feat(parser/diff): more hints in comments (#54)
All checks were successful
build / build (push) Successful in 1m17s
build / trigger-build-image (push) Successful in 8s

This commit is contained in:
张泊明518370910136 2024-10-11 04:23:46 -04:00
parent bc733f3944
commit b46e22471f
GPG Key ID: D47306D7062CDA9D

View File

@ -72,7 +72,9 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
if compareChars(string(answer), result.Files[output.FileName],
output.CompareSpace) {
score += output.Score
comment += "Pass!\n"
} else {
comment += "Fail!\n"
comment += fmt.Sprintf("Difference found in `%s`.\n",
output.FileName)
if !output.AlwaysHide {
@ -92,6 +94,8 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
"```diff\n%s\n```\n",
diffOutput,
)
} else {
comment += "(Content hidden.)\n"
}
}
}