-
-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 " | ||
] | ||
} | ||
] | ||
} |