MCPcopy
hub / github.com/google/mangle / TestDescrCheckingPositive

Function TestDescrCheckingPositive

analysis/declcheck_test.go:190–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

188}
189
190func TestDescrCheckingPositive(t *testing.T) {
191 tests := []struct {
192 name string
193 descrAtoms []ast.Atom
194 }{
195 {
196 name: "one-arg doc atom",
197 descrAtoms: []ast.Atom{docAtomOne, argAtomBar, argAtomBaz},
198 },
199 {
200 name: "two-args doc atoms",
201 descrAtoms: []ast.Atom{ast.NewAtom("doc", ast.String("a foo predicate"), ast.String("does a lot of work")), argAtomBar, argAtomBaz},
202 },
203 }
204 for _, test := range tests {
205 t.Run(test.name, func(t *testing.T) {
206 c := newDeclChecker(mustDecl(test.descrAtoms, nil, nil))
207 if errs := c.check(); errs != nil {
208 t.Error(errs[0])
209 }
210 })
211 }
212}
213
214func TestDescrCheckingNegative(t *testing.T) {
215 tests := []struct {

Callers

nothing calls this directly

Calls 6

NewAtomFunction · 0.92
StringFunction · 0.92
newDeclCheckerFunction · 0.85
mustDeclFunction · 0.85
ErrorMethod · 0.80
checkMethod · 0.45

Tested by

no test coverage detected