MCPcopy Index your code
hub / github.com/aws/aws-lambda-go / TestStartHandlerFunc

Function TestStartHandlerFunc

lambda/entry_generic_test.go:17–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestStartHandlerFunc(t *testing.T) {
18 actual := "unexpected"
19 logFatalf = func(format string, v ...interface{}) {
20 actual = fmt.Sprintf(format, v...)
21 }
22
23 f := func(context.Context, any) (any, error) { return 1, nil }
24 StartHandlerFunc(f)
25
26 assert.Equal(t, "expected AWS Lambda environment variables [_LAMBDA_SERVER_PORT AWS_LAMBDA_RUNTIME_API] are not defined", actual)
27
28 handlerType := reflect.TypeOf(f)
29
30 handlerTakesContext, err := handlerTakesContext(handlerType)
31 assert.NoError(t, err)
32 assert.True(t, handlerTakesContext)
33
34 err = validateReturns(handlerType)
35 assert.NoError(t, err)
36}

Callers

nothing calls this directly

Calls 3

StartHandlerFuncFunction · 0.85
handlerTakesContextFunction · 0.85
validateReturnsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…