Skip to content

rectangles: Make exercise schema-compliant #698

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 1 commit into from
Mar 11, 2017
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
17 changes: 16 additions & 1 deletion exercises/rectangles/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
{
"#": [
"exercise": "rectangles",
"version": "1.0.0",
"comments": [
"The inputs are represented as arrays of strings to improve readability in this JSON file.",
"Your track may choose whether to present the input as a single string (concatenating all the lines) or as the list."
],
"cases": [
{
"description": "no rows",
"property": "rectangles",
"input": [],
"expected": 0
},
{
"description": "no columns",
"property": "rectangles",
"input": [""],
"expected": 0
},
{
"description": "no rectangles",
"property": "rectangles",
"input": [" "],
"expected": 0
},
{
"description": "one rectangle",
"property": "rectangles",
"input": [
"+-+",
"| |",
Expand All @@ -30,6 +36,7 @@
},
{
"description": "two rectangles without shared parts",
"property": "rectangles",
"input": [
" +-+",
" | |",
Expand All @@ -41,6 +48,7 @@
},
{
"description": "five rectangles with shared parts",
"property": "rectangles",
"input": [
" +-+",
" | |",
Expand All @@ -52,6 +60,7 @@
},
{
"description": "rectangle of height 1 is counted",
"property": "rectangles",
"input": [
"+--+",
"+--+"
Expand All @@ -60,6 +69,7 @@
},
{
"description": "rectangle of width 1 is counted",
"property": "rectangles",
"input": [
"++",
"||",
Expand All @@ -69,6 +79,7 @@
},
{
"description": "1x1 square is counted",
"property": "rectangles",
"input": [
"++",
"++"
Expand All @@ -77,6 +88,7 @@
},
{
"description": "only complete rectangles are counted",
"property": "rectangles",
"input": [
" +-+",
" |",
Expand All @@ -88,6 +100,7 @@
},
{
"description": "rectangles can be of different sizes",
"property": "rectangles",
"input": [
"+------+----+",
"| | |",
Expand All @@ -99,6 +112,7 @@
},
{
"description": "corner is required for a rectangle to be complete",
"property": "rectangles",
"input": [
"+------+----+",
"| | |",
Expand All @@ -110,6 +124,7 @@
},
{
"description": "large input with many rectangles",
"property": "rectangles",
"input": [
"+---+--+----+",
"| +--+----+",
Expand Down