Skip to content

Grains: Add canonical-data.json file #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions exercises/grains/canonical-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"#": [
"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": {
"description": "returns the number of grains on the square",
"cases": [
{
"description": "1",
"input": 1,
"expected": 1
},
{
"description": "2",
"input": 2,
"expected": 2
},
{
"description": "3",
"input": 3,
"expected": 4
},
{
"description": "4",
"input": 4,
"expected": 8
},
{
"description": "16",
"input": 16,
"expected": 32768
},
{
"description": "32",
"input": 32,
"expected": 2147483648
},
{
"description": "64",
"input": 64,
"expected": 9223372036854775808
},
{
"description": "square 0 raises an execption",
"input": 0,
"expected": -1
},
{
"description": "negative square raises an execption",
"input": -1,
"expected": -1
},
{
"description": "square greater than 64 raises an execption",
"input": 65,
"expected": -1
}
]
},
"total": {
"description": "returns the total number of grains on the board",
"expected": 18446744073709551615
}
}