mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 10:41:19 +00:00
18 lines
322 B
Go
18 lines
322 B
Go
|
package kv
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
testpb "github.com/prysmaticlabs/prysm/proto/testing"
|
||
|
)
|
||
|
|
||
|
func Test_encode_handlesNilFromFunction(t *testing.T) {
|
||
|
foo := func() *testpb.Puzzle {
|
||
|
return nil
|
||
|
}
|
||
|
_, err := encode(foo())
|
||
|
if err == nil || err.Error() != "cannot encode nil message" {
|
||
|
t.Fatalf("Wrong error %v", err)
|
||
|
}
|
||
|
}
|