-
-
Notifications
You must be signed in to change notification settings - Fork 546
/
Copy pathcanonical-data.json
220 lines (220 loc) · 6.62 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
{
"exercise": "dnd-character",
"comments": [
"The random generator 'ability' can be property-tested.",
"The pure function 'modifier' can be tested totally.",
"The random generator 'character' should return some",
"kind of structure with six random abilities and a",
"hitpoint score. This structure can be property-tested",
"in the same way as 'ability' and 'modifier'.",
"",
"It may be fun to provide a 'name' property for characters",
"that may or may not be randomly generated but not tested.",
"",
"Many programming languages feature property-based test",
"frameworks. For a language-agnostic introduction to",
"property-based testing, see:",
"",
"https://hypothesis.works/articles/what-is-property-based-testing/"
],
"cases": [
{
"description": "ability modifier",
"cases": [
{
"uuid": "1e9ae1dc-35bd-43ba-aa08-e4b94c20fa37",
"description": "ability modifier for score 3 is -4",
"property": "modifier",
"input": {
"score": 3
},
"expected": -4
},
{
"uuid": "cc9bb24e-56b8-4e9e-989d-a0d1a29ebb9c",
"description": "ability modifier for score 4 is -3",
"property": "modifier",
"input": {
"score": 4
},
"expected": -3
},
{
"uuid": "5b519fcd-6946-41ee-91fe-34b4f9808326",
"description": "ability modifier for score 5 is -3",
"property": "modifier",
"input": {
"score": 5
},
"expected": -3
},
{
"uuid": "dc2913bd-6d7a-402e-b1e2-6d568b1cbe21",
"description": "ability modifier for score 6 is -2",
"property": "modifier",
"input": {
"score": 6
},
"expected": -2
},
{
"uuid": "099440f5-0d66-4b1a-8a10-8f3a03cc499f",
"description": "ability modifier for score 7 is -2",
"property": "modifier",
"input": {
"score": 7
},
"expected": -2
},
{
"uuid": "cfda6e5c-3489-42f0-b22b-4acb47084df0",
"description": "ability modifier for score 8 is -1",
"property": "modifier",
"input": {
"score": 8
},
"expected": -1
},
{
"uuid": "c70f0507-fa7e-4228-8463-858bfbba1754",
"description": "ability modifier for score 9 is -1",
"property": "modifier",
"input": {
"score": 9
},
"expected": -1
},
{
"uuid": "6f4e6c88-1cd9-46a0-92b8-db4a99b372f7",
"description": "ability modifier for score 10 is 0",
"property": "modifier",
"input": {
"score": 10
},
"expected": 0
},
{
"uuid": "e00d9e5c-63c8-413f-879d-cd9be9697097",
"description": "ability modifier for score 11 is 0",
"property": "modifier",
"input": {
"score": 11
},
"expected": 0
},
{
"uuid": "eea06f3c-8de0-45e7-9d9d-b8cab4179715",
"description": "ability modifier for score 12 is +1",
"property": "modifier",
"input": {
"score": 12
},
"expected": 1
},
{
"uuid": "9c51f6be-db72-4af7-92ac-b293a02c0dcd",
"description": "ability modifier for score 13 is +1",
"property": "modifier",
"input": {
"score": 13
},
"expected": 1
},
{
"uuid": "94053a5d-53b6-4efc-b669-a8b5098f7762",
"description": "ability modifier for score 14 is +2",
"property": "modifier",
"input": {
"score": 14
},
"expected": 2
},
{
"uuid": "8c33e7ca-3f9f-4820-8ab3-65f2c9e2f0e2",
"description": "ability modifier for score 15 is +2",
"property": "modifier",
"input": {
"score": 15
},
"expected": 2
},
{
"uuid": "c3ec871e-1791-44d0-b3cc-77e5fb4cd33d",
"description": "ability modifier for score 16 is +3",
"property": "modifier",
"input": {
"score": 16
},
"expected": 3
},
{
"uuid": "3d053cee-2888-4616-b9fd-602a3b1efff4",
"description": "ability modifier for score 17 is +3",
"property": "modifier",
"input": {
"score": 17
},
"expected": 3
},
{
"uuid": "bafd997a-e852-4e56-9f65-14b60261faee",
"description": "ability modifier for score 18 is +4",
"property": "modifier",
"input": {
"score": 18
},
"expected": 4
}
]
},
{
"uuid": "4f28f19c-2e47-4453-a46a-c0d365259c14",
"description": "random ability is within range",
"scenarios": ["random"],
"property": "ability",
"input": {},
"expected": "score >= 3 && score <= 18"
},
{
"uuid": "385d7e72-864f-4e88-8279-81a7d75b04ad",
"description": "random character is valid",
"scenarios": ["random"],
"property": "character",
"input": {},
"expected": {
"strength": "strength >= 3 && strength <= 18",
"dexterity": "dexterity >= 3 && dexterity <= 18",
"constitution": "constitution >= 3 && constitution <= 18",
"intelligence": "intelligence >= 3 && intelligence <= 18",
"wisdom": "wisdom >= 3 && wisdom <= 18",
"charisma": "charisma >= 3 && charisma <= 18",
"hitpoints": "hitpoints == 10 + modifier(constitution)"
}
},
{
"uuid": "2ca77b9b-c099-46c3-a02c-0d0f68ffa0fe",
"description": "each ability is only calculated once",
"property": "strength",
"input": {},
"expected": "strength == strength"
},
{
"uuid": "dca2b2ec-f729-4551-84b9-078876bb4808",
"reimplements": "2ca77b9b-c099-46c3-a02c-0d0f68ffa0fe",
"description": "each ability is only calculated once",
"comments": [
"Expected values were changed to cover all character abilities"
],
"property": "character",
"input": {},
"expected": {
"strength": "strength == strength",
"dexterity": "dexterity == dexterity",
"constitution": "constitution == constitution",
"intelligence": "intelligence == intelligence",
"wisdom": "wisdom == wisdom",
"charisma": "charisma == charisma"
}
}
]
}