func TestAdd(t *testing.T) {
for _, tc := range []struct {
a, b, want int
}{
{1, 2, 3},
{0, 0, 0},
{-1, 1, 0},
} {
t.Run("", func(t *testing.T) {
if got := add(tc.a, tc.b); got != tc.want {
t.fatalf("add(%d, %d) = %d, want %d", tc.a, tc.b, got, tc.want)
}
})
}
}
func BenchmarkAdd(b *testing.B) {
for i := 0; i < b.N; i++ {
add(1, 2)
}
}