MCPcopy Create free account
hub / github.com/github/gh-aw / TestRenderSlice_WithTitleDepth0

Function TestRenderSlice_WithTitleDepth0

pkg/console/render_slice_test.go:48–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestRenderSlice_WithTitleDepth0(t *testing.T) {
49 var output strings.Builder
50 data := []string{"a", "b", "c"}
51 val := reflect.ValueOf(data)
52
53 renderSlice(val, "My List", &output, 0)
54
55 result := output.String()
56 // Depth 0 should use single # header
57 if !strings.Contains(result, "# My List") {
58 t.Errorf("Output should contain '# My List' header, got: %q", result)
59 }
60 // Should not have ## or ###
61 if strings.Contains(result, "##") {
62 t.Errorf("Depth 0 should only use single #, got: %q", result)
63 }
64}
65
66func TestRenderSlice_WithTitleDepth1(t *testing.T) {
67 var output strings.Builder

Callers

nothing calls this directly

Calls 3

renderSliceFunction · 0.85
StringMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected