Simplify errors tests a bit so they don't all have to write a schema (#196)

Some of the errors tests need to have their own schema, so the schema
can do something weird (or even be entirely invalid!).  But most can
still share a schema.  In this commit I have those indeed share a
schema, to avoid having to have a bunch of copies of mostly the same
schema.  While doing so I noticed one error whose location wasn't very
useful, and fixed it.

Test plan: make check
This commit is contained in:
Ben Kraft
2022-05-15 12:20:18 -07:00
committed by GitHub
parent 39cd158d33
commit d4ec64fef1
10 changed files with 26 additions and 37 deletions
+2 -1
View File
@@ -294,7 +294,8 @@ func (g *generator) convertDefinition(
globalBinding, ok := g.Config.Bindings[def.Name]
if ok && options.Bind != "-" {
if options.TypeName != "" {
return nil, errorf(pos,
// The option position (in the query) is more useful here.
return nil, errorf(options.pos,
"typename option conflicts with global binding for %s; "+
"use `bind: \"-\"` to override it", def.Name)
}