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

Function TestSpec_PublicAPI_RenderTable

pkg/console/spec_test.go:391–416  ·  view source on GitHub ↗

TestSpec_PublicAPI_RenderTable validates the documented RenderTable function. Specification: "Renders a formatted table with optional title and total row."

(t *testing.T)

Source from the content-addressed store, hash-verified

389// TestSpec_PublicAPI_RenderTable validates the documented RenderTable function.
390// Specification: "Renders a formatted table with optional title and total row."
391func TestSpec_PublicAPI_RenderTable(t *testing.T) {
392 t.Run("renders headers and rows", func(t *testing.T) {
393 config := TableConfig{
394 Headers: []string{"Name", "Status", "Duration"},
395 Rows: [][]string{
396 {"build", "success", "1m30s"},
397 {"test", "failure", "45s"},
398 },
399 }
400 result := RenderTable(config)
401 assert.NotEmpty(t, result, "RenderTable should return non-empty output")
402 assert.Contains(t, result, "build", "RenderTable output should include row data")
403 assert.Contains(t, result, "success", "RenderTable output should include row data")
404 })
405
406 t.Run("renders optional title", func(t *testing.T) {
407 config := TableConfig{
408 Headers: []string{"Name", "Status"},
409 Rows: [][]string{{"build", "success"}},
410 Title: "Job Results",
411 }
412 result := RenderTable(config)
413 assert.Contains(t, result, "Job Results",
414 "RenderTable should include the optional title when set")
415 })
416}
417
418// TestSpec_PublicAPI_RenderTitleBox validates the documented RenderTitleBox function.
419// Specification: "Returns a rounded-border box containing title, padded to at least width characters."

Callers

nothing calls this directly

Calls 2

RenderTableFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected