(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestMultiplyMany(t *testing.T) { |
| 51 | t.Parallel() |
| 52 | type testCase struct { |
| 53 | inputs []float64 |
| 54 | want float64 |
| 55 | } |
| 56 | testCases := []testCase{ |
| 57 | {inputs: []float64{}, want: 0}, |
| 58 | {inputs: []float64{2}, want: 2}, |
| 59 | {inputs: []float64{2, 2}, want: 4}, |
| 60 | {inputs: []float64{1, 2, 3, 4}, want: 24}, |
| 61 | } |
| 62 | for _, tc := range testCases { |
| 63 | got := calculator.MultiplyMany(tc.inputs...) |
| 64 | if tc.want != got { |
| 65 | t.Errorf("MultiplyMany(%v): want %f, got %f", |
| 66 | tc.inputs, tc.want, got) |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | func TestDivideMany(t *testing.T) { |
| 72 | t.Parallel() |
nothing calls this directly
no outgoing calls
no test coverage detected