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

Function TestRenderSlice_MixedContentInList

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

Source from the content-addressed store, hash-verified

255}
256
257func TestRenderSlice_MixedContentInList(t *testing.T) {
258 var output strings.Builder
259 // Test with various characters that might need formatting
260 data := []string{
261 "simple",
262 "with spaces",
263 "with\nnewline",
264 "", // empty string
265 "special-chars!@#",
266 }
267 val := reflect.ValueOf(data)
268
269 renderSlice(val, "", &output, 0)
270
271 result := output.String()
272
273 // All items should be in the output
274 if !strings.Contains(result, "• simple") {
275 t.Error("Output should contain first item")
276 }
277 if !strings.Contains(result, "• with spaces") {
278 t.Error("Output should contain item with spaces")
279 }
280 if !strings.Contains(result, "special-chars!@#") {
281 t.Error("Output should contain item with special characters")
282 }
283}

Callers

nothing calls this directly

Calls 3

renderSliceFunction · 0.85
StringMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected