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

Function TestMeanUsingRightShift

math/binary/arithmeticmean_test.go:23–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestMeanUsingRightShift(t *testing.T) {
24 tests := getTests()
25 for _, tv := range tests {
26 t.Run(tv.name, func(t *testing.T) {
27 result := MeanUsingRightShift(tv.a, tv.b)
28 if result != tv.result {
29 t.Errorf("Wrong result! Expected:%d, returned:%d ", tv.result, result)
30 }
31 })
32 }
33
34}
35func getTests() []struct {
36 name string
37 a int

Callers

nothing calls this directly

Calls 2

MeanUsingRightShiftFunction · 0.85
getTestsFunction · 0.70

Tested by

no test coverage detected