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

Function TestPartitionProblem

dynamic/partitionproblem_test.go:30–39  ·  view source on GitHub ↗

TestPartitionProblem tests the PartitionProblem function with different test cases

(t *testing.T)

Source from the content-addressed store, hash-verified

28
29// TestPartitionProblem tests the PartitionProblem function with different test cases
30func TestPartitionProblem(t *testing.T) {
31 t.Run("Partition Problem test cases", func(t *testing.T) {
32 for _, tc := range getPartitionProblemTestCases() {
33 actual := dynamic.PartitionProblem(tc.nums)
34 if actual != tc.expected {
35 t.Errorf("PartitionProblem(%v) = %v; expected %v", tc.nums, actual, tc.expected)
36 }
37 }
38 })
39}

Callers

nothing calls this directly

Calls 2

PartitionProblemFunction · 0.92

Tested by

no test coverage detected