1
0
forked from JOJ/JOJ3

feat(parser/diff): log index & isSame

This commit is contained in:
张泊明518370910136 2025-03-03 18:41:35 -05:00
parent 187b5f7057
commit 8924f174b4
Signed by untrusted user: 张泊明518370910136
GPG Key ID: D47306D7062CDA9D

View File

@ -49,13 +49,22 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
if err != nil {
return nil, true, err
}
slog.Debug("compare", "filename", output.FileName,
"answer path", output.AnswerPath,
"actual length", len(result.Files[output.FileName]),
"answer length", len(string(answer)))
isSame := compareStrings(
string(answer),
result.Files[output.FileName],
output.CompareSpace,
)
slog.Debug(
"compare",
"filename", output.FileName,
"answerPath", output.AnswerPath,
"actualLength", len(result.Files[output.FileName]),
"answerLength", len(string(answer)),
"index", i,
"isSame", isSame,
)
// If no difference, assign score
if compareStrings(string(answer), result.Files[output.FileName],
output.CompareSpace) {
if isSame {
score += output.Score
comment += conf.PassComment
} else {