From 36faf10e1611bd7e90cb8f119aa0ac86a012a626 Mon Sep 17 00:00:00 2001 From: Mr Rogers Date: Tue, 24 Jan 2017 14:29:21 -0800 Subject: [PATCH] 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 --- exercises/prime-factors/canonical-data.json | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 exercises/prime-factors/canonical-data.json diff --git a/exercises/prime-factors/canonical-data.json b/exercises/prime-factors/canonical-data.json new file mode 100644 index 0000000000..c9f3721e55 --- /dev/null +++ b/exercises/prime-factors/canonical-data.json @@ -0,0 +1,42 @@ +{ + "for": { + "description": "returns prime factors for the given input number", + "cases": [ + { + "description" : "no factors", + "input" : 1, + "expected" : [] + }, + { + "description" : "prime number", + "input" : 2, + "expected" : [2] + }, + { + "description" : "square of a prime", + "input" : 9, + "expected" : [3, 3] + }, + { + "description" : "cube of a prime", + "input" : 8, + "expected" : [2, 2, 2] + }, + { + "description" : "product of primes and non-primes", + "input" : 12, + "expected" : [2, 2, 3] + }, + { + "description" : "product of primes", + "input" : 901255, + "expected" : [5, 17, 23, 461] + }, + { + "description" : "factors include a large prime", + "input" : 93819012551, + "expected" : [11, 9539, 894119] + } + ] + } +}