(out string, err error)
| 382 | } |
| 383 | |
| 384 | func (z *ZTest) diffInternal(out string, err error) error { |
| 385 | var outDiffErr, errDiffErr error |
| 386 | if z.Output != out { |
| 387 | outDiffErr = diffErr("output", z.Output, out) |
| 388 | } |
| 389 | var errStr string |
| 390 | if err != nil { |
| 391 | // Append newline if err doesn't end with one. |
| 392 | errStr = strings.TrimSuffix(err.Error(), "\n") + "\n" |
| 393 | } |
| 394 | if z.Error != errStr { |
| 395 | errDiffErr = diffErr("error", z.Error, errStr) |
| 396 | } |
| 397 | return errors.Join(outDiffErr, errDiffErr) |
| 398 | } |
| 399 | |
| 400 | func (z *ZTest) Run(t *testing.T, path, filename string) { |
| 401 | if msg := z.ShouldSkip(path); msg != "" { |
no test coverage detected