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"
|
|
|
|
|
2023-03-17 18:52:56 +00:00
|
|
|
testpb "github.com/prysmaticlabs/prysm/v4/proto/testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v4/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
|
|
|
}
|