chore(parser/diff): remove newline in pass/fail comment
This commit is contained in:
parent
b1d03573da
commit
e34cba9b17
|
@ -8,8 +8,8 @@ import "github.com/joint-online-judge/JOJ3/internal/stage"
|
||||||
var name = "diff"
|
var name = "diff"
|
||||||
|
|
||||||
type Conf struct {
|
type Conf struct {
|
||||||
PassComment string `default:"🥳Passed!\n"`
|
PassComment string `default:"🥳Passed!"`
|
||||||
FailComment string `default:"🧐Failed...\n"`
|
FailComment string `default:"🧐Failed..."`
|
||||||
FailOnNotAccepted bool `default:"true"`
|
FailOnNotAccepted bool `default:"true"`
|
||||||
ForceQuitOnFailed bool `default:"false"`
|
ForceQuitOnFailed bool `default:"false"`
|
||||||
Cases []struct {
|
Cases []struct {
|
||||||
|
|
|
@ -31,7 +31,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
if conf.ForceQuitOnFailed {
|
if conf.ForceQuitOnFailed {
|
||||||
forceQuit = true
|
forceQuit = true
|
||||||
}
|
}
|
||||||
comment += conf.FailComment
|
comment += conf.FailComment + "\n"
|
||||||
comment += "Executor status not `Accepted`\n"
|
comment += "Executor status not `Accepted`\n"
|
||||||
} else {
|
} else {
|
||||||
for _, output := range caseConf.Outputs {
|
for _, output := range caseConf.Outputs {
|
||||||
|
@ -58,12 +58,12 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
// If no difference, assign score
|
// If no difference, assign score
|
||||||
if isSame {
|
if isSame {
|
||||||
score += output.Score
|
score += output.Score
|
||||||
comment += conf.PassComment
|
comment += conf.PassComment + "\n"
|
||||||
} else {
|
} else {
|
||||||
if output.ForceQuitOnDiff || conf.ForceQuitOnFailed {
|
if output.ForceQuitOnDiff || conf.ForceQuitOnFailed {
|
||||||
forceQuit = true
|
forceQuit = true
|
||||||
}
|
}
|
||||||
comment += conf.FailComment
|
comment += conf.FailComment + "\n"
|
||||||
comment += fmt.Sprintf("Difference found in `%s`\n",
|
comment += fmt.Sprintf("Difference found in `%s`\n",
|
||||||
output.FileName)
|
output.FileName)
|
||||||
if !output.AlwaysHide {
|
if !output.AlwaysHide {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user