2020-02-13 20:34:50 +00:00
|
|
|
package kv
|
|
|
|
|
|
|
|
import (
|
2020-07-01 04:00:49 +00:00
|
|
|
"context"
|
2020-02-13 20:34:50 +00:00
|
|
|
"testing"
|
|
|
|
|
2022-08-16 12:20:13 +00:00
|
|
|
testpb "github.com/prysmaticlabs/prysm/v3/proto/testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/testing/require"
|
2020-02-13 20:34:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func Test_encode_handlesNilFromFunction(t *testing.T) {
|
|
|
|
foo := func() *testpb.Puzzle {
|
|
|
|
return nil
|
|
|
|
}
|
2020-07-01 04:00:49 +00:00
|
|
|
_, err := encode(context.Background(), foo())
|
2020-08-08 18:39:01 +00:00
|
|
|
require.ErrorContains(t, "cannot encode nil message", err)
|
2020-02-13 20:34:50 +00:00
|
|
|
}
|