Skip to content

Commit 36faf10

Browse files
committed
prime-factors: add canonical data
Rewrite with shorter descriptions that speak to the functionality not the values in the tests - based on PR review discussions
1 parent 60ae1d7 commit 36faf10

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"for": {
3+
"description": "returns prime factors for the given input number",
4+
"cases": [
5+
{
6+
"description" : "no factors",
7+
"input" : 1,
8+
"expected" : []
9+
},
10+
{
11+
"description" : "prime number",
12+
"input" : 2,
13+
"expected" : [2]
14+
},
15+
{
16+
"description" : "square of a prime",
17+
"input" : 9,
18+
"expected" : [3, 3]
19+
},
20+
{
21+
"description" : "cube of a prime",
22+
"input" : 8,
23+
"expected" : [2, 2, 2]
24+
},
25+
{
26+
"description" : "product of primes and non-primes",
27+
"input" : 12,
28+
"expected" : [2, 2, 3]
29+
},
30+
{
31+
"description" : "product of primes",
32+
"input" : 901255,
33+
"expected" : [5, 17, 23, 461]
34+
},
35+
{
36+
"description" : "factors include a large prime",
37+
"input" : 93819012551,
38+
"expected" : [11, 9539, 894119]
39+
}
40+
]
41+
}
42+
}

0 commit comments

Comments
 (0)