chore(parser/diff): simpler variables
This commit is contained in:
parent
ee117b388b
commit
9f78569447
|
@ -39,17 +39,19 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, true, err
|
return nil, true, err
|
||||||
}
|
}
|
||||||
|
answerStr := string(answer)
|
||||||
|
resultStr := result.Files[output.FileName]
|
||||||
isSame := stringsEqual(
|
isSame := stringsEqual(
|
||||||
string(answer),
|
answerStr,
|
||||||
result.Files[output.FileName],
|
resultStr,
|
||||||
output.CompareSpace,
|
output.CompareSpace,
|
||||||
)
|
)
|
||||||
slog.Debug(
|
slog.Info(
|
||||||
"compare",
|
"compare",
|
||||||
"filename", output.FileName,
|
"filename", output.FileName,
|
||||||
"answerPath", output.AnswerPath,
|
"answerPath", output.AnswerPath,
|
||||||
"actualLength", len(result.Files[output.FileName]),
|
"actualLength", len(resultStr),
|
||||||
"answerLength", len(string(answer)),
|
"answerLength", len(answerStr),
|
||||||
"index", i,
|
"index", i,
|
||||||
"isSame", isSame,
|
"isSame", isSame,
|
||||||
)
|
)
|
||||||
|
@ -73,8 +75,6 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
}
|
}
|
||||||
// Convert answer to string and split by lines
|
// Convert answer to string and split by lines
|
||||||
truncated := false
|
truncated := false
|
||||||
answerStr := string(answer)
|
|
||||||
resultStr := result.Files[output.FileName]
|
|
||||||
if len(answerStr) > output.MaxDiffLength {
|
if len(answerStr) > output.MaxDiffLength {
|
||||||
answerStr = answerStr[:output.MaxDiffLength]
|
answerStr = answerStr[:output.MaxDiffLength]
|
||||||
truncated = true
|
truncated = true
|
||||||
|
|
Loading…
Reference in New Issue
Block a user