TestSpec_PublicAPI_RenderTable validates the documented RenderTable function. Specification: "Renders a formatted table with optional title and total row."
(t *testing.T)
| 389 | // TestSpec_PublicAPI_RenderTable validates the documented RenderTable function. |
| 390 | // Specification: "Renders a formatted table with optional title and total row." |
| 391 | func 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." |
nothing calls this directly
no test coverage detected