(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestAbs(t *testing.T) { |
| 10 | tests := getTests() |
| 11 | for _, test := range tests { |
| 12 | t.Run(test.name, func(t *testing.T) { |
| 13 | if got := Abs(test.n); got != test.want { |
| 14 | t.Errorf("Abs() = %v, want %v", got, test.want) |
| 15 | } |
| 16 | }) |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | func getTests() []struct { |
| 21 | name string |