MCPcopy
hub / github.com/golang/protobuf / TestRepeatedNilText

Function TestRepeatedNilText

proto/text_test.go:627–648  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

625}
626
627func TestRepeatedNilText(t *testing.T) {
628 m := &pb2.MessageList{
629 Message: []*pb2.MessageList_Message{
630 nil,
631 &pb2.MessageList_Message{
632 Name: proto.String("Horse"),
633 },
634 nil,
635 },
636 }
637 want := `Message {
638}
639Message {
640 name: "Horse"
641}
642Message {
643}
644`
645 if got := proto.MarshalTextString(m); got != want {
646 t.Errorf("got:\n%s\n\nwant:\n%s", got, want)
647 }
648}
649
650func TestProto3Text(t *testing.T) {
651 tests := []struct {

Callers

nothing calls this directly

Calls 2

StringFunction · 0.92
MarshalTextStringFunction · 0.92

Tested by

no test coverage detected