Skip to content

Commit

Permalink
prime-factors: apply "input" policy
Browse files Browse the repository at this point in the history
  • Loading branch information
rpottsoh committed Jan 27, 2018
1 parent c2f553f commit d928874
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions exercises/prime-factors/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,64 @@
{
"exercise": "prime-factors",
"version": "1.0.0",
"version": "1.1.0",
"cases": [
{
"description": "returns prime factors for the given input number",
"cases": [
{
"description": "no factors",
"property": "factors",
"input": 1,
"input": {
"value": 1
},
"expected": []
},
{
"description": "prime number",
"property": "factors",
"input": 2,
"input": {
"value": 2
},
"expected": [2]
},
{
"description": "square of a prime",
"property": "factors",
"input": 9,
"input": {
"value": 9
},
"expected": [3, 3]
},
{
"description": "cube of a prime",
"property": "factors",
"input": 8,
"input": {
"value": 8
},
"expected": [2, 2, 2]
},
{
"description": "product of primes and non-primes",
"property": "factors",
"input": 12,
"input": {
"value": 12
},
"expected": [2, 2, 3]
},
{
"description": "product of primes",
"property": "factors",
"input": 901255,
"input": {
"value": 901255
},
"expected": [5, 17, 23, 461]
},
{
"description": "factors include a large prime",
"property": "factors",
"input": 93819012551,
"input": {
"value": 93819012551
},
"expected": [11, 9539, 894119]
}
]
Expand Down

0 comments on commit d928874

Please sign in to comment.