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

Function TestSumOfProperDivisors

math/perfectnumber_test.go:91–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func TestSumOfProperDivisors(t *testing.T) {
92 for _, tc := range getSumOfProperDivisorsTestCases() {
93 actual := math.SumOfProperDivisors(tc.input)
94 if actual != tc.expected {
95 t.Errorf(
96 "Expected SumOfProperDivisors(%d) to be: %d, but got: %d",
97 tc.input, tc.expected, actual)
98 }
99 }
100}
101
102func BenchmarkSumOfProperDivisors(b *testing.B) {
103 for i := 0; i < b.N; i++ {

Callers

nothing calls this directly

Calls 2

SumOfProperDivisorsFunction · 0.92

Tested by

no test coverage detected