| 188 | } |
| 189 | |
| 190 | func 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 | |
| 214 | func TestDescrCheckingNegative(t *testing.T) { |
| 215 | tests := []struct { |