MCPcopy Create free account
hub / github.com/brimdata/super / check

Method check

ztest/ztest.go:285–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

283}
284
285func (z *ZTest) check() error {
286 if z.Script != "" {
287 if z.Outputs == nil {
288 return errors.New("outputs field missing in a sh test")
289 }
290 for _, f := range z.Inputs {
291 if err := f.check(); err != nil {
292 return err
293 }
294 if f.Re != "" {
295 return fmt.Errorf("%s: cannot use regexp in an input", f.Name)
296 }
297 }
298 for _, f := range z.Outputs {
299 if err := f.check(); err != nil {
300 return err
301 }
302 }
303 } else if z.SPQ == "" {
304 return errors.New("either a spq field or script field must be present")
305 }
306 return nil
307}
308
309// FromYAMLFile loads ztests from the named YAML file.
310func FromYAMLFile(name string) ([]*ZTest, error) {

Callers 2

RunScriptMethod · 0.95
RunInternalMethod · 0.95

Calls 2

NewMethod · 0.80
checkMethod · 0.45

Tested by

no test coverage detected