feat(parser/diff): add pass/fail comment to conf
This commit is contained in:
parent
ad0918bbde
commit
2a2166f1ad
|
@ -21,7 +21,9 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Conf struct {
|
type Conf struct {
|
||||||
Cases []struct {
|
PassComment string `default:"🥳Passed!\n"`
|
||||||
|
FailComment string `default:"🧐Failed...\n"`
|
||||||
|
Cases []struct {
|
||||||
IgnoreResultStatus bool
|
IgnoreResultStatus bool
|
||||||
Outputs []struct {
|
Outputs []struct {
|
||||||
Score int
|
Score int
|
||||||
|
@ -72,9 +74,9 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
if compareChars(string(answer), result.Files[output.FileName],
|
if compareChars(string(answer), result.Files[output.FileName],
|
||||||
output.CompareSpace) {
|
output.CompareSpace) {
|
||||||
score += output.Score
|
score += output.Score
|
||||||
comment += "Pass!\n"
|
comment += conf.PassComment
|
||||||
} else {
|
} else {
|
||||||
comment += "Fail!\n"
|
comment += conf.FailComment
|
||||||
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