fix(parser/diff): add cases on non-accepted
This commit is contained in:
parent
505f776e6e
commit
96ed65f05d
|
@ -63,8 +63,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
}
|
}
|
||||||
comment += conf.FailComment
|
comment += conf.FailComment
|
||||||
comment += "Executor status not `Accepted`\n"
|
comment += "Executor status not `Accepted`\n"
|
||||||
continue
|
} else {
|
||||||
}
|
|
||||||
for _, output := range caseConf.Outputs {
|
for _, output := range caseConf.Outputs {
|
||||||
answer, err := os.ReadFile(output.AnswerPath)
|
answer, err := os.ReadFile(output.AnswerPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -100,7 +99,11 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
}
|
}
|
||||||
// Generate diff block with surrounding context
|
// Generate diff block with surrounding context
|
||||||
diffOutput := generateDiffWithContext(
|
diffOutput := generateDiffWithContext(
|
||||||
stdoutLines, resultLines, diffOps, output.MaxDiffLength)
|
stdoutLines,
|
||||||
|
resultLines,
|
||||||
|
diffOps,
|
||||||
|
output.MaxDiffLength,
|
||||||
|
)
|
||||||
diffOutput = strings.TrimSuffix(diffOutput, "\n \n")
|
diffOutput = strings.TrimSuffix(diffOutput, "\n \n")
|
||||||
comment += fmt.Sprintf(
|
comment += fmt.Sprintf(
|
||||||
"```diff\n%s\n```\n",
|
"```diff\n%s\n```\n",
|
||||||
|
@ -111,6 +114,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
res = append(res, stage.ParserResult{
|
res = append(res, stage.ParserResult{
|
||||||
Score: score,
|
Score: score,
|
||||||
Comment: comment,
|
Comment: comment,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user