MCPcopy Index your code
hub / github.com/DoNewsCode/core / TestNew_missingDependencyErrorMessage

Function TestNew_missingDependencyErrorMessage

c_test.go:167–182  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

165}
166
167func TestNew_missingDependencyErrorMessage(t *testing.T) {
168 defer func() {
169 if r := recover(); r != nil {
170 if strings.Contains(r.(error).Error(), "\"reflect\".makeFuncStub") {
171 t.Error("should not contain reflection stub")
172 }
173 return
174 }
175 t.Error("test should panic")
176 }()
177 c := New()
178 c.Provide(di.Deps{mockConstructor})
179 c.Invoke(func(a a) error {
180 return nil
181 })
182}
183
184func TestC_cleanup(t *testing.T) {
185 var dependencyCleanupCalled bool

Callers

nothing calls this directly

Calls 4

ProvideMethod · 0.80
InvokeMethod · 0.80
NewFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected