trackler 2.0.8.13 → 2.0.8.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/common/exercises/acronym/canonical-data.json +50 -39
  3. data/common/exercises/all-your-base/canonical-data.json +192 -146
  4. data/common/exercises/allergies/canonical-data.json +133 -93
  5. data/common/exercises/anagram/canonical-data.json +128 -106
  6. data/common/exercises/atbash-cipher/canonical-data.json +92 -74
  7. data/common/exercises/binary/canonical-data.json +94 -77
  8. data/common/exercises/bob/canonical-data.json +154 -127
  9. data/common/exercises/book-store/canonical-data.json +106 -92
  10. data/common/exercises/change/canonical-data.json +80 -68
  11. data/common/exercises/grains/canonical-data.json +75 -60
  12. data/common/exercises/hello-world/canonical-data.json +6 -6
  13. data/common/exercises/leap/canonical-data.json +28 -22
  14. data/common/exercises/luhn/canonical-data.json +16 -1
  15. data/common/exercises/pig-latin/canonical-data.json +93 -75
  16. data/common/exercises/raindrops/canonical-data.json +112 -92
  17. data/common/exercises/rna-transcription/canonical-data.json +64 -54
  18. data/common/exercises/run-length-encoding/canonical-data.json +20 -0
  19. data/common/exercises/run-length-encoding/description.md +3 -7
  20. data/common/exercises/say/canonical-data.json +98 -81
  21. data/common/exercises/scrabble-score/canonical-data.json +13 -0
  22. data/common/exercises/sieve/canonical-data.json +48 -42
  23. data/common/exercises/trinary/canonical-data.json +75 -60
  24. data/common/exercises/word-count/canonical-data.json +116 -54
  25. data/common/exercises/wordy/canonical-data.json +101 -83
  26. data/lib/trackler/version.rb +1 -1
  27. data/tracks/delphi/SETUP.md +10 -1
  28. data/tracks/delphi/config.json +8 -0
  29. data/tracks/delphi/docs/TESTS.md +4 -0
  30. data/tracks/delphi/exercises/hello-world/uTestHelloWorld.pas +49 -27
  31. data/tracks/delphi/exercises/triangle/Triangle.dpr +60 -0
  32. data/tracks/delphi/exercises/triangle/uTestTriangle.pas +186 -0
  33. data/tracks/delphi/exercises/triangle/uTriangleExample.pas +64 -0
  34. data/tracks/go/exercises/poker/poker_test.go +6 -6
  35. data/tracks/java/exercises/atbash-cipher/src/test/java/AtbashTest.java +2 -1
  36. data/tracks/scala/config.json +10 -0
  37. data/tracks/scala/exercises/variable-length-quantity/HINTS.md +2 -0
  38. data/tracks/scala/exercises/variable-length-quantity/build.sbt +3 -0
  39. data/tracks/scala/exercises/variable-length-quantity/example.scala +56 -0
  40. data/tracks/scala/exercises/variable-length-quantity/src/main/scala/VariableLengthQuantity.scala +0 -0
  41. data/tracks/scala/exercises/variable-length-quantity/src/test/scala/VariableLengthQuantityTest.scala +162 -0
  42. data/tracks/scala/testgen/src/main/scala/VariableLengthQuantityTestGenerator.scala +80 -0
  43. data/tracks/typescript/common/package.json +6 -7
  44. data/tracks/typescript/common/yarn.lock +422 -380
  45. data/tracks/typescript/config.json +12 -0
  46. data/tracks/typescript/exercises/anagram/package.json +6 -7
  47. data/tracks/typescript/exercises/anagram/yarn.lock +422 -380
  48. data/tracks/typescript/exercises/beer-song/package.json +6 -7
  49. data/tracks/typescript/exercises/beer-song/yarn.lock +422 -380
  50. data/tracks/typescript/exercises/bob/package.json +6 -7
  51. data/tracks/typescript/exercises/bob/yarn.lock +422 -380
  52. data/tracks/typescript/exercises/food-chain/package.json +6 -7
  53. data/tracks/typescript/exercises/food-chain/yarn.lock +422 -380
  54. data/tracks/typescript/exercises/gigasecond/package.json +6 -7
  55. data/tracks/typescript/exercises/gigasecond/yarn.lock +422 -380
  56. data/tracks/typescript/exercises/grade-school/grade-school.example.ts +31 -0
  57. data/tracks/typescript/exercises/grade-school/grade-school.test.ts +81 -0
  58. data/tracks/typescript/exercises/grade-school/package.json +36 -0
  59. data/tracks/typescript/exercises/grade-school/tsconfig.json +21 -0
  60. data/tracks/typescript/exercises/grade-school/tslint.json +127 -0
  61. data/tracks/typescript/exercises/grade-school/yarn.lock +2739 -0
  62. data/tracks/typescript/exercises/hamming/package.json +6 -7
  63. data/tracks/typescript/exercises/hamming/yarn.lock +422 -380
  64. data/tracks/typescript/exercises/hello-world/package.json +6 -7
  65. data/tracks/typescript/exercises/hello-world/yarn.lock +422 -380
  66. data/tracks/typescript/exercises/leap/package.json +6 -7
  67. data/tracks/typescript/exercises/leap/yarn.lock +422 -380
  68. data/tracks/typescript/exercises/pangram/package.json +6 -7
  69. data/tracks/typescript/exercises/pangram/yarn.lock +422 -380
  70. data/tracks/typescript/exercises/phone-number/package.json +6 -7
  71. data/tracks/typescript/exercises/phone-number/yarn.lock +422 -380
  72. data/tracks/typescript/exercises/rna-transcription/package.json +6 -7
  73. data/tracks/typescript/exercises/rna-transcription/yarn.lock +422 -380
  74. data/tracks/typescript/exercises/robot-name/package.json +36 -0
  75. data/tracks/typescript/exercises/robot-name/robot-name.example.ts +36 -0
  76. data/tracks/typescript/exercises/robot-name/robot-name.test.ts +86 -0
  77. data/tracks/typescript/exercises/robot-name/tsconfig.json +21 -0
  78. data/tracks/typescript/exercises/robot-name/tslint.json +127 -0
  79. data/tracks/typescript/exercises/robot-name/yarn.lock +2739 -0
  80. data/tracks/typescript/exercises/say/package.json +6 -7
  81. data/tracks/typescript/exercises/say/yarn.lock +422 -380
  82. data/tracks/typescript/exercises/word-count/package.json +6 -7
  83. data/tracks/typescript/exercises/word-count/yarn.lock +422 -380
  84. data/tracks/typescript/exercises/wordy/package.json +6 -7
  85. data/tracks/typescript/exercises/wordy/yarn.lock +422 -380
  86. metadata +23 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be4829a9e4c7af9a44b4ff36b33726b1e8b8a763
4
- data.tar.gz: 4a9e2b1deb132c3610b91ae482f5e8860f5974d8
3
+ metadata.gz: f495f28a576503455eb2749eec1817235e48a609
4
+ data.tar.gz: c9276d4e561fc5122e8a1c15b7ecafafb983d746
5
5
  SHA512:
6
- metadata.gz: 8afa4247bd983207ea963acefc10f4725741a4bc14f3fe84a28f95ae5431085e92ebf42a04faccaa55e87b00dc27417f1c587b0b19131d69c570b2475e609e3e
7
- data.tar.gz: 81472680474c9394108c90481a29047168554329a87f079c48d4b0f3da2fa71b66c2e221f638f62a78c496aeb0a6a5a675a259e521e473e20c99dc8d26f21757
6
+ metadata.gz: ec0fdb62e954d9c10772f81f130377ff32de49c4b055d7c05b7cb0481746c11ad00d7c845872e0d239ca0769d4076a2e233fe7d68f606654f5431c0b65ea0d1a
7
+ data.tar.gz: 57baf1579064267dc182ed725697510b3114ec975d1f29796e95bac4b696ddc3ea8111b0a6f63d351b3a2ac449939c97cc817deb7c2190ecb2e118fcf7adc384
@@ -1,42 +1,53 @@
1
1
  {
2
- "abbreviate": {
3
- "description": "Abbreviate a phrase",
4
- "cases": [
5
- {
6
- "description": "basic",
7
- "phrase": "Portable Network Graphics",
8
- "expected": "PNG"
9
- },
10
- {
11
- "description": "lowercase words",
12
- "phrase": "Ruby on Rails",
13
- "expected": "ROR"
14
- },
15
- {
16
- "description": "camelcase",
17
- "phrase": "HyperText Markup Language",
18
- "expected": "HTML"
19
- },
20
- {
21
- "description": "punctuation",
22
- "phrase": "First In, First Out",
23
- "expected": "FIFO"
24
- },
25
- {
26
- "description": "all caps words",
27
- "phrase": "PHP: Hypertext Preprocessor",
28
- "expected": "PHP"
29
- },
30
- {
31
- "description": "non-acronym all caps word",
32
- "phrase": "GNU Image Manipulation Program",
33
- "expected": "GIMP"
34
- },
35
- {
36
- "description": "hyphenated",
37
- "phrase": "Complementary metal-oxide semiconductor",
38
- "expected": "CMOS"
39
- }
40
- ]
2
+ "exercise": "acronym",
3
+ "version": "1.0.0",
4
+ "cases": [
5
+ {
6
+ "description": "Abbreviate a phrase",
7
+ "cases": [
8
+ {
9
+ "description": "basic",
10
+ "property": "abbreviate",
11
+ "phrase": "Portable Network Graphics",
12
+ "expected": "PNG"
13
+ },
14
+ {
15
+ "description": "lowercase words",
16
+ "property": "abbreviate",
17
+ "phrase": "Ruby on Rails",
18
+ "expected": "ROR"
19
+ },
20
+ {
21
+ "description": "camelcase",
22
+ "property": "abbreviate",
23
+ "phrase": "HyperText Markup Language",
24
+ "expected": "HTML"
25
+ },
26
+ {
27
+ "description": "punctuation",
28
+ "property": "abbreviate",
29
+ "phrase": "First In, First Out",
30
+ "expected": "FIFO"
31
+ },
32
+ {
33
+ "description": "all caps words",
34
+ "property": "abbreviate",
35
+ "phrase": "PHP: Hypertext Preprocessor",
36
+ "expected": "PHP"
37
+ },
38
+ {
39
+ "description": "non-acronym all caps word",
40
+ "property": "abbreviate",
41
+ "phrase": "GNU Image Manipulation Program",
42
+ "expected": "GIMP"
43
+ },
44
+ {
45
+ "description": "hyphenated",
46
+ "property": "abbreviate",
47
+ "phrase": "Complementary metal-oxide semiconductor",
48
+ "expected": "CMOS"
49
+ }
50
+ ]
41
51
  }
52
+ ]
42
53
  }
@@ -1,148 +1,194 @@
1
1
  {
2
- "#": [ "It's up to each track do decide:"
3
- , ""
4
- , "1. What's the canonical representation of zero?"
5
- , " - []?"
6
- , " - [0]?"
7
- , ""
8
- , "2. What representations of zero are allowed?"
9
- , " - []?"
10
- , " - [0]?"
11
- , " - [0,0]?"
12
- , ""
13
- , "3. Are leading zeroes allowed?"
14
- , ""
15
- , "4. How should invalid input be handled?"
16
- , ""
17
- , "All the undefined cases are marked as null."
18
- , ""
19
- , "All your numeric-base are belong to [2..]. :)"
20
- ],
21
- "cases": [
22
- { "description" : "single bit one to decimal"
23
- , "input_base" : 2
24
- , "input_digits" : [1]
25
- , "output_base" : 10
26
- , "expected" : [1]
27
- },
28
- { "description" : "binary to single decimal"
29
- , "input_base" : 2
30
- , "input_digits" : [1, 0, 1]
31
- , "output_base" : 10
32
- , "expected" : [5]
33
- },
34
- { "description" : "single decimal to binary"
35
- , "input_base" : 10
36
- , "input_digits" : [5]
37
- , "output_base" : 2
38
- , "expected" : [1, 0, 1]
39
- },
40
- { "description" : "binary to multiple decimal"
41
- , "input_base" : 2
42
- , "input_digits" : [1, 0, 1, 0, 1, 0]
43
- , "output_base" : 10
44
- , "expected" : [4, 2]
45
- },
46
- { "description" : "decimal to binary"
47
- , "input_base" : 10
48
- , "input_digits" : [4, 2]
49
- , "output_base" : 2
50
- , "expected" : [1, 0, 1, 0, 1, 0]
51
- },
52
- { "description" : "trinary to hexadecimal"
53
- , "input_base" : 3
54
- , "input_digits" : [1, 1, 2, 0]
55
- , "output_base" : 16
56
- , "expected" : [2, 10]
57
- },
58
- { "description" : "hexadecimal to trinary"
59
- , "input_base" : 16
60
- , "input_digits" : [2, 10]
61
- , "output_base" : 3
62
- , "expected" : [1, 1, 2, 0]
63
- },
64
- { "description" : "15-bit integer"
65
- , "input_base" : 97
66
- , "input_digits" : [3,46,60]
67
- , "output_base" : 73
68
- , "expected" : [6,10,45]
69
- },
70
- { "description" : "empty list"
71
- , "input_base" : 2
72
- , "input_digits" : []
73
- , "output_base" : 10
74
- , "expected" : null
75
- },
76
- { "description" : "single zero"
77
- , "input_base" : 10
78
- , "input_digits" : [0]
79
- , "output_base" : 2
80
- , "expected" : null
81
- },
82
- { "description" : "multiple zeros"
83
- , "input_base" : 10
84
- , "input_digits" : [0, 0, 0]
85
- , "output_base" : 2
86
- , "expected" : null
87
- },
88
- { "description" : "leading zeros"
89
- , "input_base" : 7
90
- , "input_digits" : [0, 6, 0]
91
- , "output_base" : 10
92
- , "expected" : null
93
- },
94
- { "description" : "negative digit"
95
- , "input_base" : 2
96
- , "input_digits" : [1, -1, 1, 0, 1, 0]
97
- , "output_base" : 10
98
- , "expected" : null
99
- },
100
- { "description" : "invalid positive digit"
101
- , "input_base" : 2
102
- , "input_digits" : [1, 2, 1, 0, 1, 0]
103
- , "output_base" : 10
104
- , "expected" : null
105
- },
106
- { "description" : "first base is one"
107
- , "input_base" : 1
108
- , "input_digits" : []
109
- , "output_base" : 10
110
- , "expected" : null
111
- },
112
- { "description" : "second base is one"
113
- , "input_base" : 2
114
- , "input_digits" : [1, 0, 1, 0, 1, 0]
115
- , "output_base" : 1
116
- , "expected" : null
117
- },
118
- { "description" : "first base is zero"
119
- , "input_base" : 0
120
- , "input_digits" : []
121
- , "output_base" : 10
122
- , "expected" : null
123
- },
124
- { "description" : "second base is zero"
125
- , "input_base" : 10
126
- , "input_digits" : [7]
127
- , "output_base" : 0
128
- , "expected" : null
129
- },
130
- { "description" : "first base is negative"
131
- , "input_base" : -2
132
- , "input_digits" : [1]
133
- , "output_base" : 10
134
- , "expected" : null
135
- },
136
- { "description" : "second base is negative"
137
- , "input_base" : 2
138
- , "input_digits" : [1]
139
- , "output_base" : -7
140
- , "expected" : null
141
- },
142
- { "description" : "both bases are negative"
143
- , "input_base" : -2
144
- , "input_digits" : [1]
145
- , "output_base" : -7
146
- , "expected" : null
147
- } ]
2
+ "exercise": "all-your-base",
3
+ "version": "1.0.0",
4
+ "comments": [
5
+ "It's up to each track do decide:",
6
+ "",
7
+ "1. What's the canonical representation of zero?",
8
+ " - []?",
9
+ " - [0]?",
10
+ "",
11
+ "2. What representations of zero are allowed?",
12
+ " - []?",
13
+ " - [0]?",
14
+ " - [0,0]?",
15
+ "",
16
+ "3. Are leading zeroes allowed?",
17
+ "",
18
+ "4. How should invalid input be handled?",
19
+ "",
20
+ "All the undefined cases are marked as null.",
21
+ "",
22
+ "All your numeric-base are belong to [2..]. :)"
23
+ ],
24
+ "cases": [
25
+ {
26
+ "description": "single bit one to decimal",
27
+ "property": "rebase",
28
+ "input_base": 2,
29
+ "input_digits": [1],
30
+ "output_base": 10,
31
+ "expected": [1]
32
+ },
33
+ {
34
+ "description": "binary to single decimal",
35
+ "property": "rebase",
36
+ "input_base": 2,
37
+ "input_digits": [1, 0, 1],
38
+ "output_base": 10,
39
+ "expected": [5]
40
+ },
41
+ {
42
+ "description": "single decimal to binary",
43
+ "property": "rebase",
44
+ "input_base": 10,
45
+ "input_digits": [5],
46
+ "output_base": 2,
47
+ "expected": [1, 0, 1]
48
+ },
49
+ {
50
+ "description": "binary to multiple decimal",
51
+ "property": "rebase",
52
+ "input_base": 2,
53
+ "input_digits": [1, 0, 1, 0, 1, 0],
54
+ "output_base": 10,
55
+ "expected": [4, 2]
56
+ },
57
+ {
58
+ "description": "decimal to binary",
59
+ "property": "rebase",
60
+ "input_base": 10,
61
+ "input_digits": [4, 2],
62
+ "output_base": 2,
63
+ "expected": [1, 0, 1, 0, 1, 0]
64
+ },
65
+ {
66
+ "description": "trinary to hexadecimal",
67
+ "property": "rebase",
68
+ "input_base": 3,
69
+ "input_digits": [1, 1, 2, 0],
70
+ "output_base": 16,
71
+ "expected": [2, 10]
72
+ },
73
+ {
74
+ "description": "hexadecimal to trinary",
75
+ "property": "rebase",
76
+ "input_base": 16,
77
+ "input_digits": [2, 10],
78
+ "output_base": 3,
79
+ "expected": [1, 1, 2, 0]
80
+ },
81
+ {
82
+ "description": "15-bit integer",
83
+ "property": "rebase",
84
+ "input_base": 97,
85
+ "input_digits": [3, 46, 60],
86
+ "output_base": 73,
87
+ "expected": [6, 10, 45]
88
+ },
89
+ {
90
+ "description": "empty list",
91
+ "property": "rebase",
92
+ "input_base": 2,
93
+ "input_digits": [],
94
+ "output_base": 10,
95
+ "expected": null
96
+ },
97
+ {
98
+ "description": "single zero",
99
+ "property": "rebase",
100
+ "input_base": 10,
101
+ "input_digits": [0],
102
+ "output_base": 2,
103
+ "expected": null
104
+ },
105
+ {
106
+ "description": "multiple zeros",
107
+ "property": "rebase",
108
+ "input_base": 10,
109
+ "input_digits": [0, 0, 0],
110
+ "output_base": 2,
111
+ "expected": null
112
+ },
113
+ {
114
+ "description": "leading zeros",
115
+ "property": "rebase",
116
+ "input_base": 7,
117
+ "input_digits": [0, 6, 0],
118
+ "output_base": 10,
119
+ "expected": null
120
+ },
121
+ {
122
+ "description": "negative digit",
123
+ "property": "rebase",
124
+ "input_base": 2,
125
+ "input_digits": [1, -1, 1, 0, 1, 0],
126
+ "output_base": 10,
127
+ "expected": null
128
+ },
129
+ {
130
+ "description": "invalid positive digit",
131
+ "property": "rebase",
132
+ "input_base": 2,
133
+ "input_digits": [1, 2, 1, 0, 1, 0],
134
+ "output_base": 10,
135
+ "expected": null
136
+ },
137
+ {
138
+ "description": "first base is one",
139
+ "property": "rebase",
140
+ "input_base": 1,
141
+ "input_digits": [],
142
+ "output_base": 10,
143
+ "expected": null
144
+ },
145
+ {
146
+ "description": "second base is one",
147
+ "property": "rebase",
148
+ "input_base": 2,
149
+ "input_digits": [1, 0, 1, 0, 1, 0],
150
+ "output_base": 1,
151
+ "expected": null
152
+ },
153
+ {
154
+ "description": "first base is zero",
155
+ "property": "rebase",
156
+ "input_base": 0,
157
+ "input_digits": [],
158
+ "output_base": 10,
159
+ "expected": null
160
+ },
161
+ {
162
+ "description": "second base is zero",
163
+ "property": "rebase",
164
+ "input_base": 10,
165
+ "input_digits": [7],
166
+ "output_base": 0,
167
+ "expected": null
168
+ },
169
+ {
170
+ "description": "first base is negative",
171
+ "property": "rebase",
172
+ "input_base": -2,
173
+ "input_digits": [1],
174
+ "output_base": 10,
175
+ "expected": null
176
+ },
177
+ {
178
+ "description": "second base is negative",
179
+ "property": "rebase",
180
+ "input_base": 2,
181
+ "input_digits": [1],
182
+ "output_base": -7,
183
+ "expected": null
184
+ },
185
+ {
186
+ "description": "both bases are negative",
187
+ "property": "rebase",
188
+ "input_base": -2,
189
+ "input_digits": [1],
190
+ "output_base": -7,
191
+ "expected": null
192
+ }
193
+ ]
148
194
  }
@@ -1,109 +1,149 @@
1
1
  {
2
- "allergic_to": {
3
- "description": [
4
- "Given a number and a substance, indicate whether Tom is allergic ",
5
- "to that substance.",
6
- "Test cases for this method involve more than one assertion.",
7
- "Each case in 'expected' specifies what the method should return for",
8
- "the given substance."
9
- ],
10
- "cases": [
2
+ "exercise": "allergies",
3
+ "version": "1.0.0",
4
+ "cases": [
5
+ {
6
+ "description": "allergicTo",
7
+ "comments": [
8
+ "Given a number and a substance, indicate whether Tom is allergic ",
9
+ "to that substance.",
10
+ "Test cases for this method involve more than one assertion.",
11
+ "Each case in 'expected' specifies what the method should return for",
12
+ "the given substance."
13
+ ],
14
+ "cases": [
15
+ {
16
+ "description": "no allergies means not allergic",
17
+ "property": "allergicTo",
18
+ "score": 0,
19
+ "expected": [
11
20
  {
12
- "description": "no allergies means not allergic",
13
- "score": 0,
14
- "expected": [
15
- {
16
- "substance": "peanuts",
17
- "result": false
18
- },
19
- {
20
- "substance": "cats",
21
- "result": false
22
- },
23
- {
24
- "substance": "strawberries",
25
- "result": false
26
- }
27
- ]
21
+ "substance": "peanuts",
22
+ "result": false
28
23
  },
29
24
  {
30
- "description": "is allergic to eggs",
31
- "score": 1,
32
- "expected": [
33
- {
34
- "substance": "eggs",
35
- "result": true
36
- }
37
- ]
25
+ "substance": "cats",
26
+ "result": false
38
27
  },
39
28
  {
40
- "description": "allergic to eggs in addition to other stuff",
41
- "score": 5,
42
- "expected": [
43
- {
44
- "substance": "eggs",
45
- "result": true
46
- },
47
- {
48
- "substance": "shellfish",
49
- "result": true
50
- },
51
- {
52
- "substance": "strawberries",
53
- "result": false
54
- }
55
- ]
29
+ "substance": "strawberries",
30
+ "result": false
56
31
  }
57
- ]
58
- },
59
- "list": {
60
- "description": ["Given a number, list all things Tom is allergic to"],
61
- "cases": [
62
- {
63
- "description": "no allergies at all",
64
- "score": 0,
65
- "expected": []
66
- },
67
- {
68
- "description": "allergic to just eggs",
69
- "score": 1,
70
- "expected": ["eggs"]
71
- },
72
- {
73
- "description": "allergic to just peanuts",
74
- "score": 2,
75
- "expected": ["peanuts"]
76
- },
32
+ ]
33
+ },
34
+ {
35
+ "description": "is allergic to eggs",
36
+ "property": "allergicTo",
37
+ "score": 1,
38
+ "expected": [
77
39
  {
78
- "description": "allergic to just strawberries",
79
- "score": 8,
80
- "expected": ["strawberries"]
81
- },
82
- {
83
- "description": "allergic to eggs and peanuts",
84
- "score": 3,
85
- "expected": ["eggs", "peanuts"]
86
- },
87
- {
88
- "description": "allergic to more than eggs but not peanuts",
89
- "score": 5,
90
- "expected": ["eggs", "shellfish"]
91
- },
40
+ "substance": "eggs",
41
+ "result": true
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "description": "allergic to eggs in addition to other stuff",
47
+ "property": "allergicTo",
48
+ "score": 5,
49
+ "expected": [
92
50
  {
93
- "description": "allergic to lots of stuff",
94
- "score": 248,
95
- "expected": ["strawberries", "tomatoes", "chocolate", "pollen", "cats"]
51
+ "substance": "eggs",
52
+ "result": true
96
53
  },
97
54
  {
98
- "description": "allergic to everything",
99
- "score": 255,
100
- "expected": ["eggs", "peanuts", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"]
55
+ "substance": "shellfish",
56
+ "result": true
101
57
  },
102
58
  {
103
- "description": "ignore non allergen score parts",
104
- "score": 509,
105
- "expected": ["eggs", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"]
59
+ "substance": "strawberries",
60
+ "result": false
106
61
  }
107
- ]
62
+ ]
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ "description": "list",
68
+ "comments": [
69
+ "Given a number, list all things Tom is allergic to"
70
+ ],
71
+ "cases": [
72
+ {
73
+ "description": "no allergies at all",
74
+ "property": "list",
75
+ "score": 0,
76
+ "expected": []
77
+ },
78
+ {
79
+ "description": "allergic to just eggs",
80
+ "property": "list",
81
+ "score": 1,
82
+ "expected": ["eggs"]
83
+ },
84
+ {
85
+ "description": "allergic to just peanuts",
86
+ "property": "list",
87
+ "score": 2,
88
+ "expected": ["peanuts"]
89
+ },
90
+ {
91
+ "description": "allergic to just strawberries",
92
+ "property": "list",
93
+ "score": 8,
94
+ "expected": ["strawberries"]
95
+ },
96
+ {
97
+ "description": "allergic to eggs and peanuts",
98
+ "property": "list",
99
+ "score": 3,
100
+ "expected": ["eggs", "peanuts"]
101
+ },
102
+ {
103
+ "description": "allergic to more than eggs but not peanuts",
104
+ "property": "list",
105
+ "score": 5,
106
+ "expected": ["eggs", "shellfish"]
107
+ },
108
+ {
109
+ "description": "allergic to lots of stuff",
110
+ "property": "list",
111
+ "score": 248,
112
+ "expected": [ "strawberries",
113
+ "tomatoes",
114
+ "chocolate",
115
+ "pollen",
116
+ "cats"
117
+ ]
118
+ },
119
+ {
120
+ "description": "allergic to everything",
121
+ "property": "list",
122
+ "score": 255,
123
+ "expected": [ "eggs",
124
+ "peanuts",
125
+ "shellfish",
126
+ "strawberries",
127
+ "tomatoes",
128
+ "chocolate",
129
+ "pollen",
130
+ "cats"
131
+ ]
132
+ },
133
+ {
134
+ "description": "ignore non allergen score parts",
135
+ "property": "list",
136
+ "score": 509,
137
+ "expected": [ "eggs",
138
+ "shellfish",
139
+ "strawberries",
140
+ "tomatoes",
141
+ "chocolate",
142
+ "pollen",
143
+ "cats"
144
+ ]
145
+ }
146
+ ]
108
147
  }
148
+ ]
109
149
  }