(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func TestAbs(t *testing.T) { |
| 6 | tests := getAbsTests() |
| 7 | for _, test := range tests { |
| 8 | t.Run(test.name, func(t *testing.T) { |
| 9 | if got := Abs(test.base, test.n); got != test.want { |
| 10 | t.Errorf("Abs() = %v, want %v", got, test.want) |
| 11 | } |
| 12 | }) |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | func getAbsTests() []struct { |
| 17 | name string |
nothing calls this directly
no test coverage detected