trackler 2.0.8.16 → 2.0.8.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/common/exercises/alphametics/canonical-data.json +100 -44
  3. data/common/exercises/anagram/canonical-data.json +3 -3
  4. data/common/exercises/beer-song/canonical-data.json +75 -47
  5. data/common/exercises/binary-search/canonical-data.json +86 -74
  6. data/common/exercises/bowling/canonical-data.json +1 -1
  7. data/common/exercises/bracket-push/canonical-data.json +15 -0
  8. data/common/exercises/circular-buffer/canonical-data.json +16 -1
  9. data/common/exercises/connect/canonical-data.json +19 -7
  10. data/common/exercises/custom-set/canonical-data.json +287 -246
  11. data/common/exercises/dominoes/canonical-data.json +125 -111
  12. data/common/exercises/flatten-array/canonical-data.json +35 -28
  13. data/common/exercises/food-chain/canonical-data.json +196 -182
  14. data/common/exercises/gigasecond/canonical-data.json +51 -41
  15. data/common/exercises/isogram/canonical-data.json +59 -38
  16. data/common/exercises/pangram/canonical-data.json +69 -47
  17. data/common/exercises/perfect-numbers/canonical-data.json +3 -3
  18. data/common/exercises/phone-number/canonical-data.json +74 -55
  19. data/common/exercises/sum-of-multiples/canonical-data.json +88 -62
  20. data/lib/trackler/version.rb +1 -1
  21. data/tracks/elixir/docs/INSTALLATION.md +2 -0
  22. data/tracks/elixir/docs/LEARNING.md +2 -0
  23. data/tracks/elixir/docs/RESOURCES.md +8 -0
  24. data/tracks/groovy/docs/ABOUT.md +1 -1
  25. data/tracks/groovy/docs/LEARNING.md +5 -4
  26. data/tracks/groovy/docs/RESOURCES.md +8 -1
  27. data/tracks/rust/exercises/hello-world/GETTING_STARTED.md +29 -97
  28. metadata +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "exercise": "bowling",
3
- "version": "1",
3
+ "version": "1.0.0",
4
4
  "comments": [
5
5
  "Students should implement roll and score methods.",
6
6
  "Roll should accept a single integer.",
@@ -1,67 +1,82 @@
1
1
  {
2
+ "exercise": "bracket-push",
3
+ "version": "1.0.0",
2
4
  "cases": [
3
5
  {
4
6
  "description": "paired square brackets",
7
+ "property": "isPaired",
5
8
  "input": "[]",
6
9
  "expected": true
7
10
  },
8
11
  {
9
12
  "description": "empty string",
13
+ "property": "isPaired",
10
14
  "input": "",
11
15
  "expected": true
12
16
  },
13
17
  {
14
18
  "description": "unpaired brackets",
19
+ "property": "isPaired",
15
20
  "input": "[[",
16
21
  "expected": false
17
22
  },
18
23
  {
19
24
  "description": "wrong ordered brackets",
25
+ "property": "isPaired",
20
26
  "input": "}{",
21
27
  "expected": false
22
28
  },
23
29
  {
24
30
  "description": "paired with whitespace",
31
+ "property": "isPaired",
25
32
  "input": "{ }",
26
33
  "expected": true
27
34
  },
28
35
  {
29
36
  "description": "simple nested brackets",
37
+ "property": "isPaired",
30
38
  "input": "{[]}",
31
39
  "expected": true
32
40
  },
33
41
  {
34
42
  "description": "several paired brackets",
43
+ "property": "isPaired",
35
44
  "input": "{}[]",
36
45
  "expected": true
37
46
  },
38
47
  {
39
48
  "description": "paired and nested brackets",
49
+ "property": "isPaired",
40
50
  "input": "([{}({}[])])",
41
51
  "expected": true
42
52
  },
43
53
  {
44
54
  "description": "unopened closing brackets",
55
+ "property": "isPaired",
45
56
  "input": "{[)][]}",
46
57
  "expected": false
47
58
  },
48
59
  {
49
60
  "description": "unpaired and nested brackets",
61
+ "property": "isPaired",
50
62
  "input": "([{])",
51
63
  "expected": false
52
64
  },
53
65
  {
54
66
  "description": "paired and wrong nested brackets",
67
+ "property": "isPaired",
55
68
  "input": "[({]})",
56
69
  "expected": false
57
70
  },
58
71
  {
59
72
  "description": "math expression",
73
+ "property": "isPaired",
60
74
  "input": "(((185 + 223.85) * 15) - 543)/2",
61
75
  "expected": true
62
76
  },
63
77
  {
64
78
  "description": "complex latex expression",
79
+ "property": "isPaired",
65
80
  "input": "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)",
66
81
  "expected": true
67
82
  }
@@ -1,5 +1,7 @@
1
1
  {
2
- "#": [
2
+ "exercise": "circular-buffer",
3
+ "version": "1.0.0",
4
+ "comments": [
3
5
  "In general, these circular buffers are expected to be stateful,",
4
6
  "and each language will operate on them differently.",
5
7
  "Tests tend to perform a series of operations, some of which expect a certain result.",
@@ -25,6 +27,7 @@
25
27
  "cases": [
26
28
  {
27
29
  "description": "reading empty buffer should fail",
30
+ "property": "run",
28
31
  "capacity": 1,
29
32
  "operations": [
30
33
  {
@@ -35,6 +38,7 @@
35
38
  },
36
39
  {
37
40
  "description": "can read an item just written",
41
+ "property": "run",
38
42
  "capacity": 1,
39
43
  "operations": [
40
44
  {
@@ -51,6 +55,7 @@
51
55
  },
52
56
  {
53
57
  "description": "each item may only be read once",
58
+ "property": "run",
54
59
  "capacity": 1,
55
60
  "operations": [
56
61
  {
@@ -71,6 +76,7 @@
71
76
  },
72
77
  {
73
78
  "description": "items are read in the order they are written",
79
+ "property": "run",
74
80
  "capacity": 2,
75
81
  "operations": [
76
82
  {
@@ -97,6 +103,7 @@
97
103
  },
98
104
  {
99
105
  "description": "full buffer can't be written to",
106
+ "property": "run",
100
107
  "capacity": 1,
101
108
  "operations": [
102
109
  {
@@ -113,6 +120,7 @@
113
120
  },
114
121
  {
115
122
  "description": "a read frees up capacity for another write",
123
+ "property": "run",
116
124
  "capacity": 1,
117
125
  "operations": [
118
126
  {
@@ -139,6 +147,7 @@
139
147
  },
140
148
  {
141
149
  "description": "read position is maintained even across multiple writes",
150
+ "property": "run",
142
151
  "capacity": 3,
143
152
  "operations": [
144
153
  {
@@ -175,6 +184,7 @@
175
184
  },
176
185
  {
177
186
  "description": "items cleared out of buffer can't be read",
187
+ "property": "run",
178
188
  "capacity": 1,
179
189
  "operations": [
180
190
  {
@@ -193,6 +203,7 @@
193
203
  },
194
204
  {
195
205
  "description": "clear frees up capacity for another write",
206
+ "property": "run",
196
207
  "capacity": 1,
197
208
  "operations": [
198
209
  {
@@ -217,6 +228,7 @@
217
228
  },
218
229
  {
219
230
  "description": "clear does nothing on empty buffer",
231
+ "property": "run",
220
232
  "capacity": 1,
221
233
  "operations": [
222
234
  {
@@ -236,6 +248,7 @@
236
248
  },
237
249
  {
238
250
  "description": "overwrite acts like write on non-full buffer",
251
+ "property": "run",
239
252
  "capacity": 2,
240
253
  "operations": [
241
254
  {
@@ -261,6 +274,7 @@
261
274
  },
262
275
  {
263
276
  "description": "overwrite removes the oldest item on full buffer",
277
+ "property": "run",
264
278
  "capacity": 2,
265
279
  "operations": [
266
280
  {
@@ -291,6 +305,7 @@
291
305
  },
292
306
  {
293
307
  "description": "overwrite doesn't remove an already-read item",
308
+ "property": "run",
294
309
  "capacity": 3,
295
310
  "operations": [
296
311
  {
@@ -1,7 +1,10 @@
1
1
  {
2
+ "exercise": "connect",
3
+ "version": "1.0.0",
2
4
  "cases": [
3
5
  {
4
6
  "description": "an empty board has no winner",
7
+ "property": "winner",
5
8
  "board": [
6
9
  ". . . . .",
7
10
  " . . . . .",
@@ -13,6 +16,7 @@
13
16
  },
14
17
  {
15
18
  "description": "X can win on a 1x1 board",
19
+ "property": "winner",
16
20
  "board": [
17
21
  "X"
18
22
  ],
@@ -20,6 +24,7 @@
20
24
  },
21
25
  {
22
26
  "description": "O can win on a 1x1 board",
27
+ "property": "winner",
23
28
  "board": [
24
29
  "O"
25
30
  ],
@@ -27,6 +32,7 @@
27
32
  },
28
33
  {
29
34
  "description": "only edges does not make a winner",
35
+ "property": "winner",
30
36
  "board": [
31
37
  "O O O X",
32
38
  " X . . X",
@@ -37,6 +43,7 @@
37
43
  },
38
44
  {
39
45
  "description": "illegal diagonal does not make a winner",
46
+ "property": "winner",
40
47
  "board": [
41
48
  "X O . .",
42
49
  " O X X X",
@@ -48,17 +55,19 @@
48
55
  },
49
56
  {
50
57
  "description": "nobody wins crossing adjacent angles",
58
+ "property": "winner",
51
59
  "board": [
52
- "X . . .",
53
- " . X O .",
54
- " O . X O",
55
- " . O . X",
56
- " . . O ."
60
+ "X . . .",
61
+ " . X O .",
62
+ " O . X O",
63
+ " . O . X",
64
+ " . . O ."
57
65
  ],
58
66
  "expected": ""
59
67
  },
60
68
  {
61
69
  "description": "X wins crossing from left to right",
70
+ "property": "winner",
62
71
  "board": [
63
72
  ". O . .",
64
73
  " O X X X",
@@ -70,6 +79,7 @@
70
79
  },
71
80
  {
72
81
  "description": "O wins crossing from top to bottom",
82
+ "property": "winner",
73
83
  "board": [
74
84
  ". O . .",
75
85
  " O X X X",
@@ -81,17 +91,19 @@
81
91
  },
82
92
  {
83
93
  "description": "X wins using a convoluted path",
94
+ "property": "winner",
84
95
  "board": [
85
96
  ". X X . .",
86
97
  " X . X . X",
87
98
  " . X . X .",
88
99
  " . X X . .",
89
100
  " O O O O O"
90
- ],
101
+ ],
91
102
  "expected": "X"
92
103
  },
93
104
  {
94
105
  "description": "X wins using a spiral path",
106
+ "property": "winner",
95
107
  "board": [
96
108
  "O X X X X X X X X",
97
109
  " O X O O O O O O O",
@@ -106,4 +118,4 @@
106
118
  "expected": "X"
107
119
  }
108
120
  ]
109
- }
121
+ }
@@ -1,277 +1,318 @@
1
1
  {
2
- "#": [
3
- "These tests cover the core components of a set data structure: checking",
4
- "presence, adding, comparing and basic set operations. Other features",
5
- "such as deleting elements, checking size, sorting are not tested, but",
6
- "you can add them if they are interesting in your language",
7
- "",
8
- "Tests about mixed-type sets are not included because the ability",
9
- "to implement that will vary by language. If your language supports it",
10
- "and you want to implement mixed-type sets, feel free."
11
- ],
12
- "empty": {
13
- "description": "Returns true if the set contains no elements",
14
- "cases": [
15
- {
2
+ "exercise": "custom-set",
3
+ "version": "1.0.1",
4
+ "comments": [
5
+ "These tests cover the core components of a set data structure: checking",
6
+ "presence, adding, comparing and basic set operations. Other features",
7
+ "such as deleting elements, checking size, sorting are not tested, but",
8
+ "you can add them if they are interesting in your language",
9
+ "",
10
+ "Tests about mixed-type sets are not included because the ability",
11
+ "to implement that will vary by language. If your language supports it",
12
+ "and you want to implement mixed-type sets, feel free."
13
+ ],
14
+ "cases": [
15
+ {
16
+ "description": "Returns true if the set contains no elements",
17
+ "cases": [
18
+ {
16
19
  "description": "sets with no elements are empty",
20
+ "property": "empty",
17
21
  "set": [],
18
22
  "expected": true
19
- },
20
- {
23
+ },
24
+ {
21
25
  "description": "sets with elements are not empty",
26
+ "property": "empty",
22
27
  "set": [1],
23
28
  "expected": false
24
- }
25
- ]
26
- },
27
- "contains": {
29
+ }
30
+ ]
31
+ },
32
+ {
28
33
  "description": "Sets can report if they contain an element",
29
34
  "cases": [
30
- {
31
- "description": "nothing is contained in an empty set",
32
- "set": [],
33
- "element": 1,
34
- "expected": false
35
- },
36
- {
37
- "description": "when the element is in the set",
38
- "set": [1, 2, 3],
39
- "element": 1,
40
- "expected": true
41
- },
42
- {
43
- "description": "when the element is not in the set",
44
- "set": [1, 2, 3],
45
- "element": 4,
46
- "expected": false
47
- }
35
+ {
36
+ "description": "nothing is contained in an empty set",
37
+ "property": "contains",
38
+ "set": [],
39
+ "element": 1,
40
+ "expected": false
41
+ },
42
+ {
43
+ "description": "when the element is in the set",
44
+ "property": "contains",
45
+ "set": [1, 2, 3],
46
+ "element": 1,
47
+ "expected": true
48
+ },
49
+ {
50
+ "description": "when the element is not in the set",
51
+ "property": "contains",
52
+ "set": [1, 2, 3],
53
+ "element": 4,
54
+ "expected": false
55
+ }
48
56
  ]
49
- },
50
- "subset": {
57
+ },
58
+ {
51
59
  "description": "A set is a subset if all of its elements are contained in the other set",
52
60
  "cases": [
53
- {
54
- "description": "empty set is a subset of another empty set",
55
- "set1": [],
56
- "set2": [],
57
- "expected": true
58
- },
59
- {
60
- "description": "empty set is a subset of non-empty set",
61
- "set1": [],
62
- "set2": [1],
63
- "expected": true
64
- },
65
- {
66
- "description": "non-empty set is not a subset of empty set",
67
- "set1": [1],
68
- "set2": [],
69
- "expected": false
70
- },
71
- {
72
- "description": "set is a subset of set with exact same elements",
73
- "set1": [1, 2, 3],
74
- "set2": [1, 2, 3],
75
- "expected": true
76
- },
77
- {
78
- "description": "set is a subset of larger set with same elements",
79
- "set1": [1, 2, 3],
80
- "set2": [4, 1, 2, 3],
81
- "expected": true
82
- },
83
- {
84
- "description": "set is not a subset of set that does not contain its elements",
85
- "set1": [1, 2, 3],
86
- "set2": [4, 1, 3],
87
- "expected": false
88
- }
61
+ {
62
+ "description": "empty set is a subset of another empty set",
63
+ "property": "subset",
64
+ "set1": [],
65
+ "set2": [],
66
+ "expected": true
67
+ },
68
+ {
69
+ "description": "empty set is a subset of non-empty set",
70
+ "property": "subset",
71
+ "set1": [],
72
+ "set2": [1],
73
+ "expected": true
74
+ },
75
+ {
76
+ "description": "non-empty set is not a subset of empty set",
77
+ "property": "subset",
78
+ "set1": [1],
79
+ "set2": [],
80
+ "expected": false
81
+ },
82
+ {
83
+ "description": "set is a subset of set with exact same elements",
84
+ "property": "subset",
85
+ "set1": [1, 2, 3],
86
+ "set2": [1, 2, 3],
87
+ "expected": true
88
+ },
89
+ {
90
+ "description": "set is a subset of larger set with same elements",
91
+ "property": "subset",
92
+ "set1": [1, 2, 3],
93
+ "set2": [4, 1, 2, 3],
94
+ "expected": true
95
+ },
96
+ {
97
+ "description": "set is not a subset of set that does not contain its elements",
98
+ "property": "subset",
99
+ "set1": [1, 2, 3],
100
+ "set2": [4, 1, 3],
101
+ "expected": false
102
+ }
89
103
  ]
90
- },
91
- "disjoint": {
104
+ },
105
+ {
92
106
  "description": "Sets are disjoint if they share no elements",
93
107
  "cases": [
94
- {
95
- "description": "the empty set is disjoint with itself",
96
- "set1": [],
97
- "set2": [],
98
- "expected": true
99
- },
100
- {
101
- "description": "empty set is disjoint with non-empty set",
102
- "set1": [],
103
- "set2": [1],
104
- "expected": true
105
- },
106
- {
107
- "description": "non-empty set is disjoint with empty set",
108
- "set1": [1],
109
- "set2": [],
110
- "expected": true
111
- },
112
- {
113
- "description": "sets are not disjoint if they share an element",
114
- "set1": [1, 2],
115
- "set2": [2, 3],
116
- "expected": false
117
- },
118
- {
119
- "description": "sets are disjoint if they share no elements",
120
- "set1": [1, 2],
121
- "set2": [3, 4],
122
- "expected": true
123
- }
108
+ {
109
+ "description": "the empty set is disjoint with itself",
110
+ "property": "disjoint",
111
+ "set1": [],
112
+ "set2": [],
113
+ "expected": true
114
+ },
115
+ {
116
+ "description": "empty set is disjoint with non-empty set",
117
+ "property": "disjoint",
118
+ "set1": [],
119
+ "set2": [1],
120
+ "expected": true
121
+ },
122
+ {
123
+ "description": "non-empty set is disjoint with empty set",
124
+ "property": "disjoint",
125
+ "set1": [1],
126
+ "set2": [],
127
+ "expected": true
128
+ },
129
+ {
130
+ "description": "sets are not disjoint if they share an element",
131
+ "property": "disjoint",
132
+ "set1": [1, 2],
133
+ "set2": [2, 3],
134
+ "expected": false
135
+ },
136
+ {
137
+ "description": "sets are disjoint if they share no elements",
138
+ "property": "disjoint",
139
+ "set1": [1, 2],
140
+ "set2": [3, 4],
141
+ "expected": true
142
+ }
124
143
  ]
125
- },
126
- "equal": {
144
+ },
145
+ {
127
146
  "description": "Sets with the same elements are equal",
128
147
  "cases": [
129
- {
130
- "description": "empty sets are equal",
131
- "set1": [],
132
- "set2": [],
133
- "expected": true
134
- },
135
- {
136
- "description": "empty set is not equal to non-empty set",
137
- "set1": [],
138
- "set2": [1, 2, 3],
139
- "expected": false
140
- },
141
- {
142
- "description": "non-empty set is not equal to empty set",
143
- "set1": [1, 2, 3],
144
- "set2": [],
145
- "expected": false
146
- },
147
- {
148
- "description": "sets with the same elements are equal",
149
- "set1": [1, 2],
150
- "set2": [2, 1],
151
- "expected": true
152
- },
153
- {
154
- "description": "sets with different elements are not equal",
155
- "set1": [1, 2, 3],
156
- "set2": [1, 2, 4],
157
- "expected": false
158
- }
148
+ {
149
+ "description": "empty sets are equal",
150
+ "property": "equal",
151
+ "set1": [],
152
+ "set2": [],
153
+ "expected": true
154
+ },
155
+ {
156
+ "description": "empty set is not equal to non-empty set",
157
+ "property": "equal",
158
+ "set1": [],
159
+ "set2": [1, 2, 3],
160
+ "expected": false
161
+ },
162
+ {
163
+ "description": "non-empty set is not equal to empty set",
164
+ "property": "equal",
165
+ "set1": [1, 2, 3],
166
+ "set2": [],
167
+ "expected": false
168
+ },
169
+ {
170
+ "description": "sets with the same elements are equal",
171
+ "property": "equal",
172
+ "set1": [1, 2],
173
+ "set2": [2, 1],
174
+ "expected": true
175
+ },
176
+ {
177
+ "description": "sets with different elements are not equal",
178
+ "property": "equal",
179
+ "set1": [1, 2, 3],
180
+ "set2": [1, 2, 4],
181
+ "expected": false
182
+ }
159
183
  ]
160
- },
161
- "add": {
184
+ },
185
+ {
162
186
  "description": "Unique elements can be added to a set",
163
187
  "cases": [
164
- {
165
- "description": "add to empty set",
166
- "set": [],
167
- "element": 3,
168
- "expected": [3]
169
- },
170
- {
171
- "description": "add to non-empty set",
172
- "set": [1, 2, 4],
173
- "element": 3,
174
- "expected": [1, 2, 3, 4]
175
- },
176
- {
177
- "description": "adding an existing element does not change the set",
178
- "set": [1, 2, 3],
179
- "element": 3,
180
- "expected": [1, 2, 3]
181
- }
188
+ {
189
+ "description": "add to empty set",
190
+ "property": "add",
191
+ "set": [],
192
+ "element": 3,
193
+ "expected": [3]
194
+ },
195
+ {
196
+ "description": "add to non-empty set",
197
+ "property": "add",
198
+ "set": [1, 2, 4],
199
+ "element": 3,
200
+ "expected": [1, 2, 3, 4]
201
+ },
202
+ {
203
+ "description": "adding an existing element does not change the set",
204
+ "property": "add",
205
+ "set": [1, 2, 3],
206
+ "element": 3,
207
+ "expected": [1, 2, 3]
208
+ }
182
209
  ]
183
- },
184
- "intersection": {
185
- "description": "Intersect returns a set of all shared elements",
210
+ },
211
+ {
212
+ "description": "Intersection returns a set of all shared elements",
186
213
  "cases": [
187
- {
188
- "description": "intersection of two empty sets is an empty set",
189
- "set1": [],
190
- "set2": [],
191
- "expected": []
192
- },
193
- {
194
- "description": "intersection of an empty set and non-empty set is an empty set",
195
- "set1": [],
196
- "set2": [3, 2, 5],
197
- "expected": []
198
- },
199
- {
200
- "description": "intersection of a non-empty set and an empty set is an empty set",
201
- "set1": [1, 2, 3, 4],
202
- "set2": [],
203
- "expected": []
204
- },
205
- {
206
- "description": "intersection of two sets with no shared elements is an empty set",
207
- "set1": [1, 2, 3],
208
- "set2": [4, 5, 6],
209
- "expected": []
210
- },
211
- {
212
- "description": "intersection of two sets with shared elements is a set of the shared elements",
213
- "set1": [1, 2, 3, 4],
214
- "set2": [3, 2, 5],
215
- "expected": [2, 3]
216
- }
214
+ {
215
+ "description": "intersection of two empty sets is an empty set",
216
+ "property": "intersection",
217
+ "set1": [],
218
+ "set2": [],
219
+ "expected": []
220
+ },
221
+ {
222
+ "description": "intersection of an empty set and non-empty set is an empty set",
223
+ "property": "intersection",
224
+ "set1": [],
225
+ "set2": [3, 2, 5],
226
+ "expected": []
227
+ },
228
+ {
229
+ "description": "intersection of a non-empty set and an empty set is an empty set",
230
+ "property": "intersection",
231
+ "set1": [1, 2, 3, 4],
232
+ "set2": [],
233
+ "expected": []
234
+ },
235
+ {
236
+ "description": "intersection of two sets with no shared elements is an empty set",
237
+ "property": "intersection",
238
+ "set1": [1, 2, 3],
239
+ "set2": [4, 5, 6],
240
+ "expected": []
241
+ },
242
+ {
243
+ "description": "intersection of two sets with shared elements is a set of the shared elements",
244
+ "property": "intersection",
245
+ "set1": [1, 2, 3, 4],
246
+ "set2": [3, 2, 5],
247
+ "expected": [2, 3]
248
+ }
217
249
  ]
218
- },
219
- "difference": {
250
+ },
251
+ {
220
252
  "description": "Difference (or Complement) of a set is a set of all elements that are only in the first set",
221
253
  "cases": [
222
- {
223
- "description": "difference of two empty sets is an empty set",
224
- "set1": [],
225
- "set2": [],
226
- "expected": []
227
- },
228
- {
229
- "description": "difference of empty set and non-empty set is an empty set",
230
- "set1": [],
231
- "set2": [3, 2, 5],
232
- "expected": []
233
- },
234
- {
235
- "description": "difference of a non-empty set and an empty set is the non-empty set",
236
- "set1": [1, 2, 3, 4],
237
- "set2": [],
238
- "expected": [1, 2, 3, 4]
239
- },
240
- {
241
- "description": "difference of two non-empty sets is a set of elements that are only in the first set",
242
- "set1": [3, 2, 1],
243
- "set2": [2, 4],
244
- "expected": [1, 3]
245
- }
254
+ {
255
+ "description": "difference of two empty sets is an empty set",
256
+ "property": "difference",
257
+ "set1": [],
258
+ "set2": [],
259
+ "expected": []
260
+ },
261
+ {
262
+ "description": "difference of empty set and non-empty set is an empty set",
263
+ "property": "difference",
264
+ "set1": [],
265
+ "set2": [3, 2, 5],
266
+ "expected": []
267
+ },
268
+ {
269
+ "description": "difference of a non-empty set and an empty set is the non-empty set",
270
+ "property": "difference",
271
+ "set1": [1, 2, 3, 4],
272
+ "set2": [],
273
+ "expected": [1, 2, 3, 4]
274
+ },
275
+ {
276
+ "description": "difference of two non-empty sets is a set of elements that are only in the first set",
277
+ "property": "difference",
278
+ "set1": [3, 2, 1],
279
+ "set2": [2, 4],
280
+ "expected": [1, 3]
281
+ }
246
282
  ]
247
- },
248
- "union": {
283
+ },
284
+ {
249
285
  "description": "Union returns a set of all elements in either set",
250
286
  "cases": [
251
- {
252
- "description": "union of empty sets is an empty set",
253
- "set1": [],
254
- "set2": [],
255
- "expected": []
256
- },
257
- {
258
- "description": "union of an empty set and non-empty set is the non-empty set",
259
- "set1": [],
260
- "set2": [2],
261
- "expected": [2]
262
- },
263
- {
264
- "description": "union of a non-empty set and empty set is the non-empty set",
265
- "set1": [1, 3],
266
- "set2": [],
267
- "expected": [1, 3]
268
- },
269
- {
270
- "description": "union of non-empty sets contains all unique elements",
271
- "set1": [1, 3],
272
- "set2": [2, 3],
273
- "expected": [3, 2, 1]
274
- }
287
+ {
288
+ "description": "union of empty sets is an empty set",
289
+ "property": "union",
290
+ "set1": [],
291
+ "set2": [],
292
+ "expected": []
293
+ },
294
+ {
295
+ "description": "union of an empty set and non-empty set is the non-empty set",
296
+ "property": "union",
297
+ "set1": [],
298
+ "set2": [2],
299
+ "expected": [2]
300
+ },
301
+ {
302
+ "description": "union of a non-empty set and empty set is the non-empty set",
303
+ "property": "union",
304
+ "set1": [1, 3],
305
+ "set2": [],
306
+ "expected": [1, 3]
307
+ },
308
+ {
309
+ "description": "union of non-empty sets contains all unique elements",
310
+ "property": "union",
311
+ "set1": [1, 3],
312
+ "set2": [2, 3],
313
+ "expected": [3, 2, 1]
314
+ }
275
315
  ]
276
- }
316
+ }
317
+ ]
277
318
  }