MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / cutRodSolTestFunc

Function cutRodSolTestFunc

dynamic/rodcutting_test.go:24–31  ·  view source on GitHub ↗
(t *testing.T, cutRodSolFunc func([]int, int) int)

Source from the content-addressed store, hash-verified

22}
23
24func 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
33func TestCutRodRec(t *testing.T) {
34 cutRodSolTestFunc(t, dynamic.CutRodRec)

Callers 2

TestCutRodRecFunction · 0.85
TestCutRodDpFunction · 0.85

Calls 1

getRodCuttingTestCasesFunction · 0.85

Tested by

no test coverage detected