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

Function TestBucketHeader

internal/ui_test.go:68–103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestBucketHeader(t *testing.T) {
69 t.Parallel()
70 b := stack.Bucket{
71 Signature: stack.Signature{
72 State: "chan receive",
73 CreatedBy: stack.Stack{
74 Calls: []stack.Call{
75 newCallLocal("main.mainImpl", stack.Args{}, "/home/user/go/src/github.com/foo/bar/baz.go", 74),
76 },
77 },
78 SleepMax: 6,
79 SleepMin: 2,
80 },
81 IDs: []int{1, 2},
82 First: true,
83 }
84 // When printing, it prints the remote path, not the transposed local path.
85 compareString(t, "B2: chan receive [2~6 minutes]D [Created by main.mainImpl @ /home/user/go/src/github.com/foo/bar/baz.go:74]A\n", testPalette.BucketHeader(&b, fullPath, true))
86 compareString(t, "C2: chan receive [2~6 minutes]D [Created by main.mainImpl @ /home/user/go/src/github.com/foo/bar/baz.go:74]A\n", testPalette.BucketHeader(&b, fullPath, false))
87 compareString(t, "B2: chan receive [2~6 minutes]D [Created by main.mainImpl @ github.com/foo/bar/baz.go:74]A\n", testPalette.BucketHeader(&b, relPath, true))
88 compareString(t, "C2: chan receive [2~6 minutes]D [Created by main.mainImpl @ github.com/foo/bar/baz.go:74]A\n", testPalette.BucketHeader(&b, relPath, false))
89 compareString(t, "B2: chan receive [2~6 minutes]D [Created by main.mainImpl @ baz.go:74]A\n", testPalette.BucketHeader(&b, basePath, true))
90 compareString(t, "C2: chan receive [2~6 minutes]D [Created by main.mainImpl @ baz.go:74]A\n", testPalette.BucketHeader(&b, basePath, false))
91
92 b = stack.Bucket{
93 Signature: stack.Signature{
94 State: "b0rked",
95 SleepMax: 6,
96 SleepMin: 6,
97 Locked: true,
98 },
99 IDs: []int{},
100 First: true,
101 }
102 compareString(t, "C0: b0rked [6 minutes] [locked]A\n", testPalette.BucketHeader(&b, basePath, false))
103}
104
105func TestStackLines(t *testing.T) {
106 t.Parallel()

Callers

nothing calls this directly

Calls 3

BucketHeaderMethod · 0.80
newCallLocalFunction · 0.70
compareStringFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…