fix(parser/diff): add cases on non-accepted
All checks were successful
submodules sync / sync (push) Successful in 32s
build / build (push) Successful in 1m5s
build / trigger-build-image (push) Successful in 7s

This commit is contained in:
张泊明518370910136 2024-11-29 01:41:31 -05:00
parent 505f776e6e
commit 96ed65f05d
GPG Key ID: D47306D7062CDA9D

View File

@ -63,8 +63,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
}
comment += conf.FailComment
comment += "Executor status not `Accepted`\n"
continue
}
} else {
for _, output := range caseConf.Outputs {
answer, err := os.ReadFile(output.AnswerPath)
if err != nil {
@ -100,7 +99,11 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
}
// Generate diff block with surrounding context
diffOutput := generateDiffWithContext(
stdoutLines, resultLines, diffOps, output.MaxDiffLength)
stdoutLines,
resultLines,
diffOps,
output.MaxDiffLength,
)
diffOutput = strings.TrimSuffix(diffOutput, "\n \n")
comment += fmt.Sprintf(
"```diff\n%s\n```\n",
@ -111,6 +114,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
}
}
}
}
res = append(res, stage.ParserResult{
Score: score,
Comment: comment,