ast,build: add build constraints to File

Updates #3
This commit is contained in:
Michael McLoughlin
2019-01-02 21:35:17 -08:00
parent d92a147644
commit 6202c2c9aa
5 changed files with 58 additions and 9 deletions

View File

@@ -67,3 +67,17 @@ func TestTextDecl(t *testing.T) {
"",
})
}
func TestConstraints(t *testing.T) {
ctx := build.NewContext()
ctx.BuildConstraintExpr("linux,386 darwin,!cgo")
ctx.BuildConstraintExpr("!noasm")
AssertPrintsLines(t, ctx, printer.NewGoAsm, []string{
"// Code generated by avo. DO NOT EDIT.",
"",
"// +build linux,386 darwin,!cgo",
"// +build !noasm",
"",
})
}