chore: FileName -> Filename
This commit is contained in:
parent
e34cba9b17
commit
498fcf2cdf
|
@ -15,7 +15,7 @@ type Conf struct {
|
||||||
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
|
||||||
|
|
|
@ -40,7 +40,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
return nil, true, err
|
return nil, true, err
|
||||||
}
|
}
|
||||||
answerStr := string(answer)
|
answerStr := string(answer)
|
||||||
resultStr := result.Files[output.FileName]
|
resultStr := result.Files[output.Filename]
|
||||||
isSame := stringsEqual(
|
isSame := stringsEqual(
|
||||||
answerStr,
|
answerStr,
|
||||||
resultStr,
|
resultStr,
|
||||||
|
@ -48,7 +48,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
)
|
)
|
||||||
slog.Debug(
|
slog.Debug(
|
||||||
"compare",
|
"compare",
|
||||||
"filename", output.FileName,
|
"filename", output.Filename,
|
||||||
"answerPath", output.AnswerPath,
|
"answerPath", output.AnswerPath,
|
||||||
"actualLength", len(resultStr),
|
"actualLength", len(resultStr),
|
||||||
"answerLength", len(answerStr),
|
"answerLength", len(answerStr),
|
||||||
|
@ -65,7 +65,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
}
|
}
|
||||||
comment += conf.FailComment + "\n"
|
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 {
|
||||||
if output.MaxDiffLength == 0 { // real default value
|
if output.MaxDiffLength == 0 { // real default value
|
||||||
output.MaxDiffLength = 2048
|
output.MaxDiffLength = 2048
|
||||||
|
|
|
@ -7,7 +7,7 @@ import "github.com/joint-online-judge/JOJ3/internal/stage"
|
||||||
var name = "log"
|
var name = "log"
|
||||||
|
|
||||||
type Conf struct {
|
type Conf struct {
|
||||||
FileName string `default:"stdout"`
|
Filename string `default:"stdout"`
|
||||||
Msg string `default:"log msg"`
|
Msg string `default:"log msg"`
|
||||||
Level int `default:"0"`
|
Level int `default:"0"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (*Log) parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
|
func (*Log) parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
|
||||||
content := executorResult.Files[conf.FileName]
|
content := executorResult.Files[conf.Filename]
|
||||||
var data map[string]any
|
var data map[string]any
|
||||||
err := json.Unmarshal([]byte(content), &data)
|
err := json.Unmarshal([]byte(content), &data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user