MCPcopy Index your code
hub / github.com/pkg/errors / TestFrameMarshalText

Function TestFrameMarshalText

json_test.go:9–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestFrameMarshalText(t *testing.T) {
10 var tests = []struct {
11 Frame
12 want string
13 }{{
14 initpc,
15 `^github.com/pkg/errors\.init(\.ializers)? .+/github\.com/pkg/errors/stack_test.go:\d+$`,
16 }, {
17 0,
18 `^unknown$`,
19 }}
20 for i, tt := range tests {
21 got, err := tt.Frame.MarshalText()
22 if err != nil {
23 t.Fatal(err)
24 }
25 if !regexp.MustCompile(tt.want).Match(got) {
26 t.Errorf("test %d: MarshalJSON:\n got %q\n want %q", i+1, string(got), tt.want)
27 }
28 }
29}
30
31func TestFrameMarshalJSON(t *testing.T) {
32 var tests = []struct {

Callers

nothing calls this directly

Calls 1

MarshalTextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…