(t *testing.T)
| 96 | } |
| 97 | |
| 98 | func TestTextMarshalerSize(t *testing.T) { |
| 99 | testType := &TextBinTestType{Value: "test"} |
| 100 | |
| 101 | // Get the size |
| 102 | size := testType.Msgsize() |
| 103 | |
| 104 | // Marshal and check the actual size matches estimate |
| 105 | data, err := testType.MarshalMsg(nil) |
| 106 | if err != nil { |
| 107 | t.Fatalf("MarshalMsg failed: %v", err) |
| 108 | } |
| 109 | |
| 110 | if len(data) > size { |
| 111 | t.Errorf("Msgsize underestimated: estimated %d, actual %d", size, len(data)) |
| 112 | } |
| 113 | |
| 114 | if size > len(data)+100 { // Allow some reasonable overhead |
| 115 | t.Errorf("Msgsize too conservative: estimated %d, actual %d", size, len(data)) |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | func TestStructWithMarshalerFields(t *testing.T) { |
| 120 | // Create a test struct with all field types populated |
nothing calls this directly
no test coverage detected
searching dependent graphs…