diff --git a/exercises/diamond/canonical-data.json b/exercises/diamond/canonical-data.json new file mode 100644 index 0000000000..1dec4a5dda --- /dev/null +++ b/exercises/diamond/canonical-data.json @@ -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 " + ] + } + ] +} \ No newline at end of file