SKILL.md
Testing
Route by Pattern
- Table-driven tests → see [table/](table/)
- Subtests with t.Run → see [subtests/](subtests/)
- Test helpers → see [helpers/](helpers/)
- Benchmarks → see [benchmarks/](benchmarks/)
Quick Check
- Tests named TestFunctionScenario
- Table tests for >2 cases
- Helpers call t.Helper()
- Parallel tests capture loop vars
Common Patterns
Basic test structure:
func Test_Function_Scenario(t *testing.T) {
// Arrange
input := "test"
// Act
result := Function(input)
// Assert
if result != expected {
t.Errorf("got %v, want %v", result, expected)
}
}