chore(parser/diff): remove newline in pass/fail comment
Some checks failed
submodules sync / sync (push) Successful in 40s
build / build (push) Successful in 1m44s
build / trigger-build-image (push) Has been cancelled

This commit is contained in:
张泊明518370910136 2025-06-21 13:13:42 -04:00
parent b1d03573da
commit e34cba9b17
GPG Key ID: D47306D7062CDA9D
2 changed files with 5 additions and 5 deletions

View File

@ -8,8 +8,8 @@ import "github.com/joint-online-judge/JOJ3/internal/stage"
var name = "diff"
type Conf struct {
PassComment string `default:"🥳Passed!\n"`
FailComment string `default:"🧐Failed...\n"`
PassComment string `default:"🥳Passed!"`
FailComment string `default:"🧐Failed..."`
FailOnNotAccepted bool `default:"true"`
ForceQuitOnFailed bool `default:"false"`
Cases []struct {

View File

@ -31,7 +31,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
if conf.ForceQuitOnFailed {
forceQuit = true
}
comment += conf.FailComment
comment += conf.FailComment + "\n"
comment += "Executor status not `Accepted`\n"
} else {
for _, output := range caseConf.Outputs {
@ -58,12 +58,12 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
// If no difference, assign score
if isSame {
score += output.Score
comment += conf.PassComment
comment += conf.PassComment + "\n"
} else {
if output.ForceQuitOnDiff || conf.ForceQuitOnFailed {
forceQuit = true
}
comment += conf.FailComment
comment += conf.FailComment + "\n"
comment += fmt.Sprintf("Difference found in `%s`\n",
output.FileName)
if !output.AlwaysHide {