-
-
Notifications
You must be signed in to change notification settings - Fork 547
/
Copy pathcanonical-data.json
139 lines (139 loc) · 5.76 KB
/
canonical-data.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{
"exercise": "diamond",
"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": [
{
"uuid": "202fb4cc-6a38-4883-9193-a29d5cb92076",
"description": "Degenerate case with a single 'A' row",
"property": "rows",
"input": {
"letter": "A"
},
"expected": [
"A"
]
},
{
"uuid": "bd6a6d78-9302-42e9-8f60-ac1461e9abae",
"description": "Degenerate case with no row containing 3 distinct groups of spaces",
"property": "rows",
"input": {
"letter": "B"
},
"expected": [
" A ",
"B B",
" A "
]
},
{
"uuid": "af8efb49-14ed-447f-8944-4cc59ce3fd76",
"description": "Smallest non-degenerate case with odd diamond side length",
"property": "rows",
"input": {
"letter": "C"
},
"expected": [
" A ",
" B B ",
"C C",
" B B ",
" A "
]
},
{
"uuid": "e0c19a95-9888-4d05-86a0-fa81b9e70d1d",
"description": "Smallest non-degenerate case with even diamond side length",
"property": "rows",
"input": {
"letter": "D"
},
"expected": [
" A ",
" B B ",
" C C ",
"D D",
" C C ",
" B B ",
" A "
]
},
{
"uuid": "82ea9aa9-4c0e-442a-b07e-40204e925944",
"description": "Largest possible diamond",
"property": "rows",
"input": {
"letter": "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 "
]
}
]
}