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

Function TestRenderSlice_SingleElementList

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

Source from the content-addressed store, hash-verified

238}
239
240func TestRenderSlice_SingleElementList(t *testing.T) {
241 var output strings.Builder
242 data := []string{"only one"}
243 val := reflect.ValueOf(data)
244
245 renderSlice(val, "Single Item", &output, 0)
246
247 result := output.String()
248
249 if !strings.Contains(result, "# Single Item") {
250 t.Error("Output should contain title")
251 }
252 if !strings.Contains(result, "• only one") {
253 t.Error("Output should contain single list item")
254 }
255}
256
257func TestRenderSlice_MixedContentInList(t *testing.T) {
258 var output strings.Builder

Callers

nothing calls this directly

Calls 3

renderSliceFunction · 0.85
StringMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected