some fixes
This commit is contained in:
@@ -37,6 +37,38 @@ group("g") {
|
||||
}
|
||||
}
|
||||
|
||||
func TestParsePatternStageAllMode(t *testing.T) {
|
||||
src := `
|
||||
build "make"
|
||||
group("g") {
|
||||
weight = 1.0
|
||||
pattern {
|
||||
dirs = "testdata/test_*"
|
||||
stage = true
|
||||
args_file = "args.txt"
|
||||
output = "answer.txt"
|
||||
}
|
||||
}
|
||||
`
|
||||
f, _, err := Parse(src)
|
||||
if err != nil {
|
||||
t.Fatalf("parse: %v", err)
|
||||
}
|
||||
pat := f.Groups[0].Pattern
|
||||
if pat == nil {
|
||||
t.Fatal("no pattern")
|
||||
}
|
||||
if !pat.StageAll {
|
||||
t.Error("StageAll = false, want true")
|
||||
}
|
||||
if pat.ArgsFile != "args.txt" {
|
||||
t.Errorf("ArgsFile = %q", pat.ArgsFile)
|
||||
}
|
||||
if pat.OutputFile != "answer.txt" {
|
||||
t.Errorf("OutputFile = %q", pat.OutputFile)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParsePatternUnknownField(t *testing.T) {
|
||||
src := `
|
||||
build "make"
|
||||
|
||||
Reference in New Issue
Block a user