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

Function TestErrors

protoc-gen-go/generator/internal/remap/remap_test.go:12–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestErrors(t *testing.T) {
13 tests := []struct {
14 in, out string
15 }{
16 {"", "x"},
17 {"x", ""},
18 {"var x int = 5\n", "var x = 5\n"},
19 {"these are \"one\" thing", "those are 'another' thing"},
20 }
21 for _, test := range tests {
22 m, err := Compute([]byte(test.in), []byte(test.out))
23 if err != nil {
24 t.Logf("Got expected error: %v", err)
25 continue
26 }
27 t.Errorf("Compute(%q, %q): got %+v, wanted error", test.in, test.out, m)
28 }
29}
30
31func TestMatching(t *testing.T) {
32 // The input is a source text that will be rearranged by the formatter.

Callers

nothing calls this directly

Calls 1

ComputeFunction · 0.85

Tested by

no test coverage detected