MCPcopy
hub / github.com/livebud/bud / TestSyntaxError

Function TestSyntaxError

framework/generator/generator_test.go:165–187  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func TestSyntaxError(t *testing.T) {
166 is := is.New(t)
167 ctx := context.Background()
168 dir := t.TempDir()
169 td := testdir.New(dir)
170 td.Files["generator/tailwind/tailwind.go"] = `
171 package tailwind
172 import (
173 "github.com/livebud/bud/package/genfs"
174 )
175 type Generator struct {}
176 func (g *Generator) Generate(fsys genfs.FS, dir *genfs.Dir) error {
177 "ok"
178 }
179 `
180 is.NoErr(td.Write(ctx))
181 cli := testcli.New(dir)
182 res, err := cli.Run(ctx, "build", "--embed=false")
183 is.True(err != nil)
184 is.In(err.Error(), `exit status 2`)
185 is.In(res.Stderr(), `"ok"`)
186 is.In(res.Stderr(), `not used`)
187}
188
189func TestUpdateGenerator(t *testing.T) {
190 is := is.New(t)

Callers

nothing calls this directly

Calls 10

NewFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
NoErrMethod · 0.80
TrueMethod · 0.80
InMethod · 0.80
RunMethod · 0.65
ErrorMethod · 0.65
WriteMethod · 0.45
StderrMethod · 0.45

Tested by

no test coverage detected