(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestAddMany(t *testing.T) { |
| 9 | t.Parallel() |
| 10 | type testCase struct { |
| 11 | inputs []float64 |
| 12 | want float64 |
| 13 | } |
| 14 | testCases := []testCase{ |
| 15 | {inputs: []float64{}, want: 0}, |
| 16 | {inputs: []float64{2}, want: 2}, |
| 17 | {inputs: []float64{2, 2}, want: 4}, |
| 18 | {inputs: []float64{1, 2, 3}, want: 6}, |
| 19 | } |
| 20 | for _, tc := range testCases { |
| 21 | got := calculator.AddMany(tc.inputs...) |
| 22 | if tc.want != got { |
| 23 | t.Errorf("AddMany(%v): want %f, got %f", |
| 24 | tc.inputs, tc.want, got) |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func TestSubtractMany(t *testing.T) { |
| 30 | t.Parallel() |
nothing calls this directly
no outgoing calls
no test coverage detected