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

Method RunInternal

ztest/ztest.go:364–382  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

362}
363
364func (z *ZTest) RunInternal(ctx context.Context) error {
365 if err := z.check(); err != nil {
366 return fmt.Errorf("bad yaml format: %w", err)
367 }
368 outputFlags := append([]string{"-f=sup", "-pretty=0"}, strings.Fields(z.OutputFlags)...)
369 inputFlags := strings.Fields(z.InputFlags)
370 if z.Vector {
371 verr := z.diffInternal(runInternal(ctx, z.SPQ, z.Input, outputFlags, inputFlags, true))
372 if verr != nil {
373 verr = fmt.Errorf("=== vector ===\n%w", verr)
374 }
375 serr := z.diffInternal(runInternal(ctx, z.SPQ, z.Input, outputFlags, inputFlags, false))
376 if serr != nil {
377 serr = fmt.Errorf("=== sequence ===\n%w", serr)
378 }
379 return errors.Join(verr, serr)
380 }
381 return z.diffInternal(runInternal(ctx, z.SPQ, z.Input, outputFlags, inputFlags, false))
382}
383
384func (z *ZTest) diffInternal(out string, err error) error {
385 var outDiffErr, errDiffErr error

Callers 3

testSuccessfulFunction · 0.95
testErrorFunction · 0.95
RunMethod · 0.95

Calls 4

checkMethod · 0.95
diffInternalMethod · 0.95
runInternalFunction · 0.85
FieldsMethod · 0.80

Tested by 2

testSuccessfulFunction · 0.76
testErrorFunction · 0.76