Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Bit-Manipulation/test/BinaryCountSetBits.test.js
Original file line number Diff line number Diff line change
@@ -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)
})