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

Function TestRenderSlice_EmptyStructSliceAsTable

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

Source from the content-addressed store, hash-verified

223}
224
225func TestRenderSlice_EmptyStructSliceAsTable(t *testing.T) {
226 var output strings.Builder
227 data := []SliceTestStruct{}
228 val := reflect.ValueOf(data)
229
230 renderSlice(val, "Empty Structs", &output, 0)
231
232 result := output.String()
233
234 // Empty slice should produce no output (early return)
235 if result != "" {
236 t.Errorf("Empty struct slice should produce no output, got: %q", result)
237 }
238}
239
240func TestRenderSlice_SingleElementList(t *testing.T) {
241 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