Added SetBit.js, SetBit.test.js in Bit-Manipulation directory

This commit is contained in:
AbhinavXT
2021-07-04 21:47:53 +05:30
parent 709de83feb
commit 51a9126053
2 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { setBit } from '../SetBit'
test('should set bit at the given bit Position', () => {
const setBitPos = setBit(1, 0)
expect(setBitPos).toBe(1)
})
test('should set bit at the given bit Position', () => {
const setBitPos = setBit(1, 0)
expect(setBitPos).toBe(1)
})
test('should set bit at the given bit Position', () => {
const setBitPos = setBit(10, 1)
expect(setBitPos).toBe(10)
})
test('should set bit at the given bit Position', () => {
const setBitPos = setBit(10, 2)
expect(setBitPos).toBe(14)
})