From dcc8791002468b38c733bc9b00e4eef0430c0477 Mon Sep 17 00:00:00 2001 From: rbasso Date: Thu, 9 Mar 2017 18:57:36 +0900 Subject: [PATCH 1/2] pascals-triangle: Make canonical-data.json compliant --- exercises/pascals-triangle/canonical-data.json | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/exercises/pascals-triangle/canonical-data.json b/exercises/pascals-triangle/canonical-data.json index 6be5dfcee0..2c3c54b01a 100644 --- a/exercises/pascals-triangle/canonical-data.json +++ b/exercises/pascals-triangle/canonical-data.json @@ -1,47 +1,58 @@ { - "#": [ + "exercise": "pascals-triangle", + "version": "1.0.0", + "comments": [ "Expectations are represented here as an array of arrays.", "How you represent this idiomatically in your language is up to you.", "An expectation of -1 indicates some sort of failure should occur" ], - "rows": { + "cases": [ + { "description": "Given a count, return a collection of that many rows of pascal's triangle", "cases": [ { "description": "zero rows", + "property": "rows", "count": 0, "expected": [] }, { "description": "single row", + "property": "rows", "count": 1, "expected": [[1]] }, { "description": "two rows", + "property": "rows", "count": 2, "expected": [[1], [1, 1]] }, { "description": "three rows", + "property": "rows", "count": 3, "expected": [[1], [1, 1], [1, 2, 1]] }, { "description": "four rows", + "property": "rows", "count": 4, "expected": [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]] }, { "description": "negative rows", + "property": "rows", "count": -1, "expected": -1 }, { "description": "null/no rows", + "property": "rows", "count": null, "expected": -1 } ] } + ] } From e9393ff749095d30e6386b4ebec8238ee53454c0 Mon Sep 17 00:00:00 2001 From: rbasso Date: Thu, 9 Mar 2017 19:03:36 +0900 Subject: [PATCH 2/2] pascals-triangle: Fix canonical-data.json formatting --- .../pascals-triangle/canonical-data.json | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/exercises/pascals-triangle/canonical-data.json b/exercises/pascals-triangle/canonical-data.json index 2c3c54b01a..2e3f68fbc9 100644 --- a/exercises/pascals-triangle/canonical-data.json +++ b/exercises/pascals-triangle/canonical-data.json @@ -1,56 +1,56 @@ { - "exercise": "pascals-triangle", - "version": "1.0.0", - "comments": [ - "Expectations are represented here as an array of arrays.", - "How you represent this idiomatically in your language is up to you.", - "An expectation of -1 indicates some sort of failure should occur" - ], - "cases": [ + "exercise": "pascals-triangle", + "version": "1.0.0", + "comments": [ + "Expectations are represented here as an array of arrays.", + "How you represent this idiomatically in your language is up to you.", + "An expectation of -1 indicates some sort of failure should occur" + ], + "cases": [ { "description": "Given a count, return a collection of that many rows of pascal's triangle", "cases": [ { - "description": "zero rows", - "property": "rows", - "count": 0, - "expected": [] + "description": "zero rows", + "property": "rows", + "count": 0, + "expected": [] }, { - "description": "single row", - "property": "rows", - "count": 1, - "expected": [[1]] + "description": "single row", + "property": "rows", + "count": 1, + "expected": [[1]] }, { - "description": "two rows", - "property": "rows", - "count": 2, - "expected": [[1], [1, 1]] + "description": "two rows", + "property": "rows", + "count": 2, + "expected": [[1], [1, 1]] }, { - "description": "three rows", - "property": "rows", - "count": 3, - "expected": [[1], [1, 1], [1, 2, 1]] + "description": "three rows", + "property": "rows", + "count": 3, + "expected": [[1], [1, 1], [1, 2, 1]] }, { - "description": "four rows", - "property": "rows", - "count": 4, - "expected": [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]] + "description": "four rows", + "property": "rows", + "count": 4, + "expected": [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]] }, { - "description": "negative rows", - "property": "rows", - "count": -1, - "expected": -1 + "description": "negative rows", + "property": "rows", + "count": -1, + "expected": -1 }, { - "description": "null/no rows", - "property": "rows", - "count": null, - "expected": -1 + "description": "null/no rows", + "property": "rows", + "count": null, + "expected": -1 } ] }