Lines Matching defs:lock

140   bunny: "Monty"
143 m6Golden = `
144 name: "David"
210 if !anyEqual(got, want) {
224 func TestMarshalUnknownAny(t *testing.T) {
278 if err.Error() != want {
283 // textMessage implements the methods that allow it to marshal and unmarshal
288 func (*textMessage) MarshalText() ([]byte, error) {
301 func (*textMessage) ProtoMessage() {}
311 Port: proto.Int32(7001),
328 Somegroup: &pb2.MyMessage_SomeGroup{
333 XXX_unrecognized: []byte{13<<3 | 0, 4},
338 if err := proto.SetExtension(msg, pb2.E_Ext_More, ext); err != nil {
351 b = append(proto.EncodeVarint(201<<3|proto.WireBytes), b...)
356 proto.SetRawExtension(msg, 202, b)
361 const text = `count: 42
373 key: 3735928559
376 others: <
377 weight: 6.022
402 t.Fatalf("proto.MarshalText: %v", err)
405 if diff := cmp.Diff(text, got); got != text {
445 tests := []struct {
456 }}, `msg:<string_field:"why hello!" >`},
473 for i := 0; i < len(src); i++ {
477 continue
495 if c == '{' {
496 space = false
532 // Test data from the same C++ test.
538 &pb2.Strings{StringField: proto.String("\x00\x01\xff\x81")},
555 pb := new(pb2.Strings)
558 }
559 if !proto.Equal(pb, tc.in) {
581 if len(p) <= avail {
584 n, _ = w.b.Write(p[:avail])
608 f float64
611 {0, "0"},
612 {4.7, "4.7"},
635 },
656 {&pb3.Message{}, ``},
657 // zero message except for an empty byte slice
683 for _, test := range tests {
707 wantBytes, err := proto.Marshal(m)
717 defer wg.Done()
720 t.Errorf("proto.MarshalTextString = %q, want %q", got, wantText)
762 if err := proto.SetExtension(msg, pb2.E_Greeting, []string{"bula", "hola"}); err != nil {
798 in: "count:42 name: 'My name is '\n'elsewhere'",
802 },
803 },
804
805 // Quoted string concatenations with mixed quotes
824 out: &pb2.MyMessage{
832 in: `count:42 name: 'Roger "The Ramster" Ramjet'`,
841 …in: `count:42 name: ` + "\"\\\"A string with \\' characters \\n and \\r newlines and \\t tabs and …
866 // Quoted string with unicode escapes.
868 in: `count: 42 name: "\u0047\U00000047\uffff\U0010ffff"`,
883 in: `count: 42 name: "\u000"`,
884 err: `line 1.16: invalid quoted string "\u000": \u requires 4 following digits`,
911 // Number in hexadecimal
937 },
966 in: `inner: < host: 12 >` + "\n",
967 err: `line 1.15: invalid string: 12`,
970 // Quoted string posing as int32
979 err: `line 1.17: invalid float: "17.4"`,
985 err: `line 1.0: unclosed type_url or extension name`,
1006 // Repeated field with list notation
1010 Count: proto.Int32(42),
1022 {},
1029 // Missing colon for inner message