From 42024da18127a01e3b3575888b89fef72c824f61 Mon Sep 17 00:00:00 2001 From: rbasso Date: Tue, 7 Mar 2017 04:34:36 +0900 Subject: [PATCH 1/2] grains: Make canonical-data.json compliant --- exercises/grains/canonical-data.json | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/exercises/grains/canonical-data.json b/exercises/grains/canonical-data.json index 3e3ba67392..3d3f892b17 100644 --- a/exercises/grains/canonical-data.json +++ b/exercises/grains/canonical-data.json @@ -1,66 +1,81 @@ { - "#": [ + "exercise": "grains", + "version": "1.0.0", + "comments": [ "The final tests of square test error conditions", "The expection for these tests is -1, indicating an error", "In these cases you should expect an error as is idiomatic for your language" ], - "square": { + "cases": [ + { "description": "returns the number of grains on the square", "cases": [ { "description": "1", + "property": "square", "input": 1, "expected": 1 }, { "description": "2", + "property": "square", "input": 2, "expected": 2 }, { "description": "3", + "property": "square", "input": 3, "expected": 4 }, { "description": "4", + "property": "square", "input": 4, "expected": 8 }, { "description": "16", + "property": "square", "input": 16, "expected": 32768 }, { "description": "32", + "property": "square", "input": 32, "expected": 2147483648 }, { "description": "64", + "property": "square", "input": 64, "expected": 9223372036854775808 }, { "description": "square 0 raises an exception", + "property": "square", "input": 0, "expected": -1 }, { "description": "negative square raises an exception", + "property": "square", "input": -1, "expected": -1 }, { "description": "square greater than 64 raises an exception", + "property": "square", "input": 65, "expected": -1 } ] }, - "total": { + { "description": "returns the total number of grains on the board", + "property": "total", "expected": 18446744073709551615 } + ] } From 2e0e77e71af7c5dcc25d01e7b83acb6bfde6afff Mon Sep 17 00:00:00 2001 From: rbasso Date: Tue, 7 Mar 2017 04:35:54 +0900 Subject: [PATCH 2/2] grains: Fix canonical-data.json formatting --- exercises/grains/canonical-data.json | 140 +++++++++++++-------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/exercises/grains/canonical-data.json b/exercises/grains/canonical-data.json index 3d3f892b17..d1bb10a081 100644 --- a/exercises/grains/canonical-data.json +++ b/exercises/grains/canonical-data.json @@ -7,75 +7,75 @@ "In these cases you should expect an error as is idiomatic for your language" ], "cases": [ - { - "description": "returns the number of grains on the square", - "cases": [ - { - "description": "1", - "property": "square", - "input": 1, - "expected": 1 - }, - { - "description": "2", - "property": "square", - "input": 2, - "expected": 2 - }, - { - "description": "3", - "property": "square", - "input": 3, - "expected": 4 - }, - { - "description": "4", - "property": "square", - "input": 4, - "expected": 8 - }, - { - "description": "16", - "property": "square", - "input": 16, - "expected": 32768 - }, - { - "description": "32", - "property": "square", - "input": 32, - "expected": 2147483648 - }, - { - "description": "64", - "property": "square", - "input": 64, - "expected": 9223372036854775808 - }, - { - "description": "square 0 raises an exception", - "property": "square", - "input": 0, - "expected": -1 - }, - { - "description": "negative square raises an exception", - "property": "square", - "input": -1, - "expected": -1 - }, - { - "description": "square greater than 64 raises an exception", - "property": "square", - "input": 65, - "expected": -1 - } - ] - }, - { - "description": "returns the total number of grains on the board", - "property": "total", - "expected": 18446744073709551615 - } + { + "description": "returns the number of grains on the square", + "cases": [ + { + "description": "1", + "property": "square", + "input": 1, + "expected": 1 + }, + { + "description": "2", + "property": "square", + "input": 2, + "expected": 2 + }, + { + "description": "3", + "property": "square", + "input": 3, + "expected": 4 + }, + { + "description": "4", + "property": "square", + "input": 4, + "expected": 8 + }, + { + "description": "16", + "property": "square", + "input": 16, + "expected": 32768 + }, + { + "description": "32", + "property": "square", + "input": 32, + "expected": 2147483648 + }, + { + "description": "64", + "property": "square", + "input": 64, + "expected": 9223372036854775808 + }, + { + "description": "square 0 raises an exception", + "property": "square", + "input": 0, + "expected": -1 + }, + { + "description": "negative square raises an exception", + "property": "square", + "input": -1, + "expected": -1 + }, + { + "description": "square greater than 64 raises an exception", + "property": "square", + "input": 65, + "expected": -1 + } + ] + }, + { + "description": "returns the total number of grains on the board", + "property": "total", + "expected": 18446744073709551615 + } ] }