MCPcopy
hub / github.com/cloudwego/hertz / Assert

Function Assert

pkg/common/test/assert/assert.go:30–40  ·  view source on GitHub ↗

Assert .

(t testingT, cond bool, val ...interface{})

Source from the content-addressed store, hash-verified

28
29// Assert .
30func Assert(t testingT, cond bool, val ...interface{}) {
31 t.Helper()
32 if !cond {
33 if len(val) > 0 {
34 val = append([]interface{}{"assertion failed:"}, val...)
35 t.Fatal(val...)
36 } else {
37 t.Fatal("assertion failed")
38 }
39 }
40}
41
42// Assertf .
43func Assertf(t testingT, cond bool, format string, val ...interface{}) {

Callers 15

TestArgsCopyToFunction · 0.92
TestArgsPeekFunction · 0.92
TestServer_RaceDetectFunction · 0.92
TestDoNonNilReqResp_ErrFunction · 0.92
TestParseFirstLineFunction · 0.92
TestNewReaderFunction · 0.92
TestReader_ReadEventFunction · 0.92
TestReader_ForEachFunction · 0.92

Calls 2

HelperMethod · 0.65
FatalMethod · 0.65

Tested by 15

TestArgsCopyToFunction · 0.74
TestArgsPeekFunction · 0.74
TestServer_RaceDetectFunction · 0.74
TestDoNonNilReqResp_ErrFunction · 0.74
TestParseFirstLineFunction · 0.74
TestNewReaderFunction · 0.74
TestReader_ReadEventFunction · 0.74
TestReader_ForEachFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…