1package uassert23import "strings"45func fail(t TestingT, customMsgs []string, failureMessage string, args ...any) bool {6 customMsg := ""7 if len(customMsgs) > 0 {8 customMsg = strings.Join(customMsgs, " ")9 }10 if customMsg != "" {11 failureMessage += " - " + customMsg12 }13 t.Errorf(failureMessage, args...)14 return false15}1617func checkDidPanic(f any, rlm realm) (didPanic bool, message string) {18 didPanic = true19 defer func() {20 r := recover()2122 if r == nil {23 message = "nil"24 return25 }2627 err, ok := r.(error)28 if ok {29 message = err.Error()30 return31 }3233 errStr, ok := r.(string)34 if ok {35 message = errStr36 return37 }3839 message = "recover: unsupported type"40 }()41 switch f := f.(type) {42 case func():43 f()44 case func(realm):45 f(cross(rlm))46 default:47 panic("f must be of type func() or func(realm)")48 }49 didPanic = false50 return51}52Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.