More detailed testing of Join is in datadriven_test.go. Here we make sure that the public API includes the stacktrace wrapper.
(t *testing.T)
| 22 | // More detailed testing of Join is in datadriven_test.go. Here we make |
| 23 | // sure that the public API includes the stacktrace wrapper. |
| 24 | func TestJoin(t *testing.T) { |
| 25 | e := errors.Join(errors.New("abc123"), errors.New("def456")) |
| 26 | printed := fmt.Sprintf("%+v", e) |
| 27 | expected := `Error types: (1) *withstack.withStack (2) *join.joinError (3) *withstack.withStack (4) *errutil.leafError (5) *withstack.withStack (6) *errutil.leafError` |
| 28 | if !strings.Contains(printed, expected) { |
| 29 | t.Errorf("Expected: %s to contain: %s", printed, expected) |
| 30 | } |
| 31 | } |