MCPcopy Index your code
hub / github.com/maruel/panicparse / TestProcessTwoSnapshots

Function TestProcessTwoSnapshots

internal/main_test.go:92–120  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

90}
91
92func TestProcessTwoSnapshots(t *testing.T) {
93 t.Parallel()
94 out := bytes.Buffer{}
95 in := bytes.Buffer{}
96 in.WriteString("Ya\n")
97 in.Write(internaltest.PanicOutputs()["simple"])
98 in.WriteString("Ye\n")
99 in.Write(internaltest.PanicOutputs()["int"])
100 in.WriteString("Yo\n")
101 err := process(&in, &out, &Palette{}, stack.AnyPointer, basePath, false, true, "", nil, nil)
102 if err != nil {
103 t.Fatal(err)
104 }
105 // This is a change detector on main.go.
106 want := ("Ya\n" +
107 "GOTRACEBACK=all\n" +
108 "panic: simple\n\n" +
109 "1: running\n" +
110 " main main.go:74 main()\n" +
111 "Ye\n" +
112 "GOTRACEBACK=all\n" +
113 "panic: 42\n\n" +
114 "1: running\n" +
115 " main main.go:93 panicint(0x2a)\n" +
116 " main main.go:315 init.func9()\n" +
117 " main main.go:76 main()\n" +
118 "Yo\n")
119 compareString(t, want, out.String())
120}
121
122func TestMainFn(t *testing.T) {
123 t.Parallel()

Callers

nothing calls this directly

Calls 5

PanicOutputsFunction · 0.92
processFunction · 0.85
WriteMethod · 0.80
compareStringFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…