Prompt Testing

Go Table-Driven Tests

Write table-driven tests with subtests and clear assertions.

gotesting
Insert label Table Tests
Prompt

Write table-driven tests for this Go code. Define test cases as a slice of structs with name, input, and expected output fields. Use t.Run for subtests so failures identify which case broke. Cover happy paths, edge cases, and error conditions.

Add this to your Facet Inserts in Crystl for one-click access.

Get Crystl