merge: Add testcases of BinaryCountSetBits function (#922)

This commit is contained in:
Ankush263
2022-03-15 14:39:18 +05:30
committed by GitHub
parent 7f479b8ced
commit 80cea0884b

View File

@@ -0,0 +1,26 @@
import { BinaryCountSetBits } from '../BinaryCountSetBits'
test('check BinaryCountSetBits of 25 is 3', () => {
const res = BinaryCountSetBits(25)
expect(res).toBe(3)
})
test('check BinaryCountSetBits of 36 is 2', () => {
const res = BinaryCountSetBits(36)
expect(res).toBe(2)
})
test('check BinaryCountSetBits of 16 is 1', () => {
const res = BinaryCountSetBits(16)
expect(res).toBe(1)
})
test('check BinaryCountSetBits of 58 is 4', () => {
const res = BinaryCountSetBits(58)
expect(res).toBe(4)
})
test('check BinaryCountSetBits of 4294967295 is 32', () => {
const res = BinaryCountSetBits(4294967295)
expect(res).toBe(32)
})
test('check BinaryCountSetBits of 0 is 0', () => {
const res = BinaryCountSetBits(0)
expect(res).toBe(0)
})