Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: add tests for Binary Equivalent Algorithm
  • Loading branch information
{Harshit Malpotra} committed Oct 14, 2023
commit edc51b27edf0960dded41069dcdd7018c1f0ef7f
16 changes: 16 additions & 0 deletions Recursive/test/BinaryEquivalent.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { binaryEquivalent } from "../BinaryEquivalent";

describe("BinaryEquivalent", () => {
it('The binary equivalent of 2 should be "10"', () => {
expect(binaryEquivalent(2)).toBe("10");
})
it('The binary equivalent of 0 should be "0"', () => {
expect(binaryEquivalent(0)).toBe("0");
})
it('The binary equivalent of 543 should be "1000011111"', () => {
expect(binaryEquivalent(543)).toBe("1000011111");
})
it('The binary equivalent of 4697621023 should be "100011000000000000000001000011111"', () => {
expect(binaryEquivalent(4697621023)).toBe("100011000000000000000001000011111");
})
})