Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit60443c7

Browse files
malpotra{Harshit Malpotra}appgurueu
authored
test: add tests for Binary Equivalent Algorithm (TheAlgorithms#1560)
* test: add tests for Binary Equivalent Algorithm* test: Refactored tests using .each()* Update BinaryEquivalent.test.js---------Co-authored-by: {Harshit Malpotra} <{malpotra.harshit@gmail.com}>Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
1 parent0315c8a commit60443c7

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import{binaryEquivalent}from"../BinaryEquivalent";
2+
3+
consttests=[
4+
{
5+
test:2,
6+
expectedValue:"10"
7+
},
8+
{
9+
test:0,
10+
expectedValue:"0"
11+
},
12+
{
13+
test:543,
14+
expectedValue:"1000011111"
15+
},
16+
{
17+
test:4697621023,
18+
expectedValue:"100011000000000000000001000011111"
19+
}
20+
]
21+
22+
describe("Binary Equivalent",()=>{
23+
test.each(tests)(
24+
"of $test should be $expectedValue",
25+
({test, expectedValue})=>{
26+
expect(binaryEquivalent(test)).toBe(expectedValue);
27+
}
28+
)
29+
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp