1
0
forked from JOJ/JOJ3

feat(parser/diff): option to force quit on diff

This commit is contained in:
张泊明518370910136 2024-10-15 03:43:19 -04:00
parent a001b26b66
commit c218c93069
Signed by untrusted user: 张泊明518370910136
GPG Key ID: D47306D7062CDA9D

View File

@ -24,11 +24,12 @@ type Conf struct {
FailComment string `default:"🧐Failed...\n"` FailComment string `default:"🧐Failed...\n"`
Cases []struct { Cases []struct {
Outputs []struct { Outputs []struct {
Score int Score int
FileName string FileName string
AnswerPath string AnswerPath string
CompareSpace bool CompareSpace bool
AlwaysHide bool AlwaysHide bool
ForceQuitOnDiff bool
} }
} }
} }
@ -67,6 +68,9 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
score += output.Score score += output.Score
comment += conf.PassComment comment += conf.PassComment
} else { } else {
if output.ForceQuitOnDiff {
forceQuit = true
}
comment += conf.FailComment comment += conf.FailComment
comment += fmt.Sprintf("Difference found in `%s`.\n", comment += fmt.Sprintf("Difference found in `%s`.\n",
output.FileName) output.FileName)