Skip to content

Commit

Permalink
diamond: add canonical data
Browse files Browse the repository at this point in the history
  • Loading branch information
stkent committed Mar 1, 2017
1 parent 62e8a1a commit 28998dd
Showing 1 changed file with 125 additions and 0 deletions.
125 changes: 125 additions & 0 deletions exercises/diamond/canonical-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"exercise": "diamond",
"version": "1.0.0",
"comments": [
" The tests contained within this canonical data file are suitable ",
" for value-based testing, in which each test case checks that the ",
" value returned by the function under test is in every way ",
" identical to a given expected value. ",
" ",
" This exercise is also amenable to property-based testing, in which ",
" each test case verifies that the value returned by the function ",
" under test exhibits a specific desired property. ",
" ",
" Several tracks (notably, C# and Go) forgo the value-based tests ",
" below in favor of property-based tests. If you are feeling ",
" adventurous and would like to use this exercise to introduce the ",
" concept of property-based testing to participants in your track, ",
" please ignore the value-based tests below and instead reference ",
" the test suites in the aforementioned tracks. "
],
"cases": [
{
"description": "Degenerate case with a single 'A' row",
"property": "rows",
"input": "A",
"expected": [
"A"
]
},
{
"description": "Degenerate case with no row containing 3 distinct groups of spaces",
"property": "rows",
"input": "B",
"expected": [
" A ",
"B B",
" A "
]
},
{
"description": "Smallest non-degenerate case with odd diamond side length",
"property": "rows",
"input": "C",
"expected": [
" A ",
" B B ",
"C C",
" B B ",
" A "
]
},
{
"description": "Smallest non-degenerate case with even diamond side length",
"property": "rows",
"input": "D",
"expected": [
" A ",
" B B ",
" C C ",
"D D",
" C C ",
" B B ",
" A "
]
},
{
"description": "Largest possible diamond",
"property": "rows",
"input": "Z",
"expected": [
" A ",
" B B ",
" C C ",
" D D ",
" E E ",
" F F ",
" G G ",
" H H ",
" I I ",
" J J ",
" K K ",
" L L ",
" M M ",
" N N ",
" O O ",
" P P ",
" Q Q ",
" R R ",
" S S ",
" T T ",
" U U ",
" V V ",
" W W ",
" X X ",
" Y Y ",
"Z Z",
" Y Y ",
" X X ",
" W W ",
" V V ",
" U U ",
" T T ",
" S S ",
" R R ",
" Q Q ",
" P P ",
" O O ",
" N N ",
" M M ",
" L L ",
" K K ",
" J J ",
" I I ",
" H H ",
" G G ",
" F F ",
" E E ",
" D D ",
" C C ",
" B B ",
" A "
]
}
]
}

0 comments on commit 28998dd

Please sign in to comment.