MCPcopy Create free account
hub / github.com/protocolbuffers/protobuf-go / TestWriteStringError

Function TestWriteStringError

internal/encoding/json/encode_test.go:385–399  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

383}
384
385func TestWriteStringError(t *testing.T) {
386 tests := []string{"abc\xff"}
387
388 for _, in := range tests {
389 t.Run(in, func(t *testing.T) {
390 enc, err := json.NewEncoder(nil, "")
391 if err != nil {
392 t.Fatalf("NewEncoder() returned error: %v", err)
393 }
394 if err := enc.WriteString(in); err == nil {
395 t.Errorf("WriteString(%v): got nil error, want error", in)
396 }
397 })
398 }
399}

Callers

nothing calls this directly

Calls 3

WriteStringMethod · 0.95
NewEncoderFunction · 0.92
RunMethod · 0.80

Tested by

no test coverage detected