C creates a unit testing case. The parameter `t` is the pointer to testing.T of stdlib (*testing.T). The parameter `f` is the closure function for unit testing case.
(t *testing.T, f func(t *T))
| 27 | // The parameter `t` is the pointer to testing.T of stdlib (*testing.T). |
| 28 | // The parameter `f` is the closure function for unit testing case. |
| 29 | func C(t *testing.T, f func(t *T)) { |
| 30 | defer func() { |
| 31 | if err := recover(); err != nil { |
| 32 | _, _ = fmt.Fprintf(os.Stderr, "%v\n%s", err, gdebug.StackWithFilter([]string{pathFilterKey})) |
| 33 | t.Fail() |
| 34 | } |
| 35 | }() |
| 36 | f(&T{t}) |
| 37 | } |
| 38 | |
| 39 | // Assert checks `value` and `expect` EQUAL. |
| 40 | func Assert(value, expect any) { |