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

Function TestIsPowerOfTwoLeftShift

math/binary/checkisnumberpoweroftwo_test.go:51–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestIsPowerOfTwoLeftShift(t *testing.T) {
52 tests := getTestsForPowerOfTwo()
53 for _, tv := range tests {
54 t.Run(tv.name, func(t *testing.T) {
55 result := IsPowerOfTwoLeftShift(uint(tv.a))
56 t.Log(tv.a, " ", result)
57 if result != tv.missing {
58 t.Errorf("Wrong result! Expected:%v, returned:%v ", tv.missing, result)
59 }
60 })
61 }
62}
63
64func TestIsPowOfTwoUseLog(t *testing.T) {
65 tests := getTestsForPowerOfTwo()

Callers

nothing calls this directly

Calls 2

IsPowerOfTwoLeftShiftFunction · 0.85
getTestsForPowerOfTwoFunction · 0.70

Tested by

no test coverage detected