(t *testing.T, cutRodSolFunc func([]int, int) int)
| 22 | } |
| 23 | |
| 24 | func cutRodSolTestFunc(t *testing.T, cutRodSolFunc func([]int, int) int) { |
| 25 | for _, tc := range getRodCuttingTestCases() { |
| 26 | actual := cutRodSolFunc(tc.price, tc.length) |
| 27 | if actual != tc.expected { |
| 28 | t.Errorf("expected: %d, got: %d", tc.expected, actual) |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | func TestCutRodRec(t *testing.T) { |
| 34 | cutRodSolTestFunc(t, dynamic.CutRodRec) |
no test coverage detected