trackler 2.2.1.36 → 2.2.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/bash/config.json +1 -0
- data/tracks/ecmascript/README.md +2 -2
- data/tracks/haskell/config/maintainers.json +2 -2
- data/tracks/java/config.json +15 -3
- data/tracks/java/exercises/difference-of-squares/src/test/java/DifferenceOfSquaresCalculatorTest.java +9 -9
- data/tracks/ruby/exercises/palindrome-products/README.md +12 -6
- data/tracks/ruby/exercises/space-age/.meta/generator/test_template.erb +1 -1
- data/tracks/ruby/lib/generator/template_values.rb +6 -0
- data/tracks/ruby/lib/generator/test_template.erb +1 -1
- data/tracks/ruby/test/generator/template_values_test.rb +3 -3
- data/tracks/rust/exercises/accumulate/.gitignore +7 -0
- data/tracks/rust/exercises/clock/.gitignore +7 -0
- data/tracks/rust/exercises/nth-prime/.gitignore +7 -0
- data/tracks/rust/exercises/pig-latin/.gitignore +7 -0
- data/tracks/rust/exercises/prime-factors/.gitignore +7 -0
- data/tracks/rust/exercises/proverb/.gitignore +7 -0
- data/tracks/rust/exercises/pythagorean-triplet/.gitignore +7 -0
- data/tracks/rust/exercises/run-length-encoding/.gitignore +7 -0
- data/tracks/rust/exercises/say/.gitignore +7 -0
- data/tracks/scala/config.json +1 -0
- data/tracks/scala/exercises/clock/src/test/scala/ClockTest.scala +73 -79
- data/tracks/scala/exercises/forth/src/test/scala/ForthTest.scala +128 -133
- data/tracks/scala/exercises/kindergarten-garden/example.scala +1 -1
- data/tracks/scala/exercises/kindergarten-garden/src/test/scala/GardenTest.scala +77 -52
- data/tracks/scala/exercises/nucleotide-count/src/main/scala/.keep +0 -0
- data/tracks/scala/exercises/nucleotide-count/src/test/scala/NucleotideCountTest.scala +21 -61
- data/tracks/scala/exercises/palindrome-products/example.scala +7 -4
- data/tracks/scala/exercises/palindrome-products/src/test/scala/PalindromeProductsTest.scala +54 -34
- data/tracks/scala/testgen/src/main/scala/ClockTestGenerator.scala +66 -0
- data/tracks/scala/testgen/src/main/scala/ForthTestGenerator.scala +66 -0
- data/tracks/scala/testgen/src/main/scala/KindergartenGardenTestGenerator.scala +48 -0
- data/tracks/scala/testgen/src/main/scala/NucleotideCountTestGenerator.scala +34 -0
- data/tracks/scala/testgen/src/main/scala/PalindromeProductsTestGenerator.scala +50 -0
- data/tracks/scala/testgen/src/main/scala/testgen/CanonicalDataParser.scala +7 -6
- data/tracks/sml/config.json +21 -0
- data/tracks/sml/exercises/phone-number/README.md +64 -0
- data/tracks/sml/exercises/phone-number/example.sml +18 -0
- data/tracks/sml/exercises/phone-number/phone-number.sml +2 -0
- data/tracks/sml/exercises/phone-number/test.sml +50 -0
- data/tracks/sml/exercises/phone-number/testlib.sml +159 -0
- data/tracks/sml/exercises/roman-numerals/README.md +79 -0
- data/tracks/sml/exercises/roman-numerals/example.sml +27 -0
- data/tracks/sml/exercises/roman-numerals/roman-numerals.sml +2 -0
- data/tracks/sml/exercises/roman-numerals/test.sml +66 -0
- data/tracks/sml/exercises/roman-numerals/testlib.sml +159 -0
- metadata +26 -3
- data/tracks/scala/exercises/nucleotide-count/src/main/scala/DNA.scala +0 -6
|
@@ -1,206 +1,201 @@
|
|
|
1
|
-
import org.scalatest.{
|
|
1
|
+
import org.scalatest.{Matchers, FunSuite}
|
|
2
|
+
|
|
3
|
+
/** @version 1.2.0 */
|
|
4
|
+
class ForthTest extends FunSuite with Matchers {
|
|
2
5
|
|
|
3
|
-
class ForthTest extends FlatSpec with Matchers with EitherValues {
|
|
4
6
|
private val forth = new Forth
|
|
5
7
|
|
|
6
|
-
"
|
|
7
|
-
forth.eval("")
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
test("parsing and numbers - empty input results in empty stack") {
|
|
9
|
+
forth.eval("").fold(_ => "", _.toString) should be ("")
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
test("parsing and numbers - numbers just get pushed onto the stack") {
|
|
13
|
+
pending
|
|
14
|
+
forth.eval("1 2 3 4 5").fold(_ => "", _.toString) should be ("1 2 3 4 5")
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
test("addition - can add two numbers") {
|
|
18
|
+
pending
|
|
19
|
+
forth.eval("1 2 +").fold(_ => "", _.toString) should be ("3")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
test("addition - errors if there is nothing on the stack") {
|
|
23
|
+
pending
|
|
24
|
+
forth.eval("+").isLeft should be (true)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
test("addition - errors if there is only one value on the stack") {
|
|
28
|
+
pending
|
|
29
|
+
forth.eval("1 +").isLeft should be (true)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
test("subtraction - can subtract two numbers") {
|
|
33
|
+
pending
|
|
34
|
+
forth.eval("3 4 -").fold(_ => "", _.toString) should be ("-1")
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
test("subtraction - errors if there is nothing on the stack") {
|
|
38
|
+
pending
|
|
39
|
+
forth.eval("-").isLeft should be (true)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
test("subtraction - errors if there is only one value on the stack") {
|
|
43
|
+
pending
|
|
44
|
+
forth.eval("1 -").isLeft should be (true)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
test("multiplication - can multiply two numbers") {
|
|
48
|
+
pending
|
|
49
|
+
forth.eval("2 4 *").fold(_ => "", _.toString) should be ("8")
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
test("multiplication - errors if there is nothing on the stack") {
|
|
53
|
+
pending
|
|
54
|
+
forth.eval("*").isLeft should be (true)
|
|
11
55
|
}
|
|
12
56
|
|
|
13
|
-
"
|
|
57
|
+
test("multiplication - errors if there is only one value on the stack") {
|
|
14
58
|
pending
|
|
15
|
-
forth.eval("1
|
|
16
|
-
case Right(state) => state.toString should equal("1 2 3 4 5")
|
|
17
|
-
case Left(error) => fail("error pushing numbers on stack - " + error)
|
|
18
|
-
}
|
|
59
|
+
forth.eval("1 *").isLeft should be (true)
|
|
19
60
|
}
|
|
20
61
|
|
|
21
|
-
"
|
|
62
|
+
test("division - can divide two numbers") {
|
|
22
63
|
pending
|
|
23
|
-
|
|
24
|
-
// Also note that if Regex is used for your solution then handling
|
|
25
|
-
// Unicode requires and additional flag in the Regex string "(?U)".
|
|
26
|
-
forth.eval("1\u00002\u00013\n4\r5 6\t7") match {
|
|
27
|
-
case Right(state) => state.toString should equal("1 2 3 4 5 6 7")
|
|
28
|
-
case Left(error) => fail("error handling non-word chars - " + error)
|
|
29
|
-
}
|
|
64
|
+
forth.eval("12 3 /").fold(_ => "", _.toString) should be ("4")
|
|
30
65
|
}
|
|
31
66
|
|
|
32
|
-
"
|
|
67
|
+
test("division - performs integer division") {
|
|
33
68
|
pending
|
|
34
|
-
forth.eval("
|
|
35
|
-
case Right(state) => state.toString should equal("-1")
|
|
36
|
-
case Left(error) => fail("error handling basic arithmetic - " + error)
|
|
37
|
-
}
|
|
69
|
+
forth.eval("8 3 /").fold(_ => "", _.toString) should be ("2")
|
|
38
70
|
}
|
|
39
71
|
|
|
40
|
-
"
|
|
72
|
+
test("division - errors if dividing by zero") {
|
|
41
73
|
pending
|
|
42
|
-
forth.eval("
|
|
43
|
-
case Right(state) => state.toString should equal("2")
|
|
44
|
-
case Left(error) => fail("error handling basic mul/div - " + error)
|
|
45
|
-
}
|
|
74
|
+
forth.eval("4 0 /").isLeft should be (true)
|
|
46
75
|
}
|
|
47
76
|
|
|
48
|
-
"division
|
|
77
|
+
test("division - errors if there is nothing on the stack") {
|
|
49
78
|
pending
|
|
50
|
-
forth.eval("
|
|
51
|
-
case Right(state) => fail("division by zero should return error")
|
|
52
|
-
case Left(error) => error should equal(ForthError.DivisionByZero)
|
|
53
|
-
}
|
|
79
|
+
forth.eval("/").isLeft should be (true)
|
|
54
80
|
}
|
|
55
81
|
|
|
56
|
-
"
|
|
82
|
+
test("division - errors if there is only one value on the stack") {
|
|
57
83
|
pending
|
|
58
|
-
forth.eval("1
|
|
59
|
-
|
|
60
|
-
case Left(error) => fail("error handling dup - " + error)
|
|
61
|
-
}
|
|
84
|
+
forth.eval("1 /").isLeft should be (true)
|
|
85
|
+
}
|
|
62
86
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
87
|
+
test("combined arithmetic - addition and subtraction") {
|
|
88
|
+
pending
|
|
89
|
+
forth.eval("1 2 + 4 -").fold(_ => "", _.toString) should be ("-1")
|
|
67
90
|
}
|
|
68
91
|
|
|
69
|
-
"
|
|
92
|
+
test("combined arithmetic - multiplication and division") {
|
|
70
93
|
pending
|
|
71
|
-
forth.eval("
|
|
72
|
-
case Right(state) => fail("dup on empty stack should return error")
|
|
73
|
-
case Left(error) => error should equal(ForthError.StackUnderflow)
|
|
74
|
-
}
|
|
94
|
+
forth.eval("2 4 * 3 /").fold(_ => "", _.toString) should be ("2")
|
|
75
95
|
}
|
|
76
96
|
|
|
77
|
-
"
|
|
97
|
+
test("dup - copies the top value on the stack") {
|
|
78
98
|
pending
|
|
79
|
-
forth.eval("1
|
|
80
|
-
case Right(state) => state.toString should equal("1")
|
|
81
|
-
case Left(error) => fail("error handling drop - " + error)
|
|
82
|
-
}
|
|
99
|
+
forth.eval("1 DUP").fold(_ => "", _.toString) should be ("1 1")
|
|
83
100
|
}
|
|
84
101
|
|
|
85
|
-
"
|
|
102
|
+
test("dup - is case-insensitive") {
|
|
86
103
|
pending
|
|
87
|
-
forth.eval("1
|
|
88
|
-
case Right(state) => state.toString should equal("")
|
|
89
|
-
case Left(error) => fail("error handling drop on 1 item stack - " + error)
|
|
90
|
-
}
|
|
104
|
+
forth.eval("1 2 Dup").fold(_ => "", _.toString) should be ("1 2 2")
|
|
91
105
|
}
|
|
92
106
|
|
|
93
|
-
"
|
|
107
|
+
test("dup - errors if there is nothing on the stack") {
|
|
94
108
|
pending
|
|
95
|
-
forth.eval("
|
|
96
|
-
case Right(state) => fail("drop on empty stack should return error")
|
|
97
|
-
case Left(error) => error should equal(ForthError.StackUnderflow)
|
|
98
|
-
}
|
|
109
|
+
forth.eval("dup").isLeft should be (true)
|
|
99
110
|
}
|
|
100
111
|
|
|
101
|
-
"
|
|
112
|
+
test("drop - removes the top value on the stack if it is the only one") {
|
|
102
113
|
pending
|
|
103
|
-
forth.eval("1
|
|
104
|
-
|
|
105
|
-
case Left(error) => fail("error handling swap - " + error)
|
|
106
|
-
}
|
|
114
|
+
forth.eval("1 drop").fold(_ => "", _.toString) should be ("")
|
|
115
|
+
}
|
|
107
116
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
117
|
+
test("drop - removes the top value on the stack if it is not the only one") {
|
|
118
|
+
pending
|
|
119
|
+
forth.eval("1 2 drop").fold(_ => "", _.toString) should be ("1")
|
|
112
120
|
}
|
|
113
121
|
|
|
114
|
-
"
|
|
122
|
+
test("drop - errors if there is nothing on the stack") {
|
|
115
123
|
pending
|
|
116
|
-
forth.eval("
|
|
117
|
-
case Right(state) => fail("swap on empty stack should return error")
|
|
118
|
-
case Left(error) => error should equal(ForthError.StackUnderflow)
|
|
119
|
-
}
|
|
124
|
+
forth.eval("drop").isLeft should be (true)
|
|
120
125
|
}
|
|
121
126
|
|
|
122
|
-
"swap on
|
|
127
|
+
test("swap - swaps the top two values on the stack if they are the only ones") {
|
|
123
128
|
pending
|
|
124
|
-
forth.eval("1 swap")
|
|
125
|
-
case Right(state) => fail("swap on single item stack should return error")
|
|
126
|
-
case Left(error) => error should equal(ForthError.StackUnderflow)
|
|
127
|
-
}
|
|
129
|
+
forth.eval("1 2 swap").fold(_ => "", _.toString) should be ("2 1")
|
|
128
130
|
}
|
|
129
131
|
|
|
130
|
-
"
|
|
132
|
+
test("swap - swaps the top two values on the stack if they are not the only ones") {
|
|
131
133
|
pending
|
|
132
|
-
forth.eval("1 2
|
|
133
|
-
|
|
134
|
-
case Left(error) => fail("error handling over - " + error)
|
|
135
|
-
}
|
|
134
|
+
forth.eval("1 2 3 swap").fold(_ => "", _.toString) should be ("1 3 2")
|
|
135
|
+
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
test("swap - errors if there is nothing on the stack") {
|
|
138
|
+
pending
|
|
139
|
+
forth.eval("swap").isLeft should be (true)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
test("swap - errors if there is only one value on the stack") {
|
|
143
|
+
pending
|
|
144
|
+
forth.eval("1 swap").isLeft should be (true)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
test("over - copies the second element if there are only two") {
|
|
148
|
+
pending
|
|
149
|
+
forth.eval("1 2 over").fold(_ => "", _.toString) should be ("1 2 1")
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
test("over - copies the second element if there are more than two") {
|
|
153
|
+
pending
|
|
154
|
+
forth.eval("1 2 3 over").fold(_ => "", _.toString) should be ("1 2 3 2")
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
test("over - errors if there is nothing on the stack") {
|
|
158
|
+
pending
|
|
159
|
+
forth.eval("over").isLeft should be (true)
|
|
141
160
|
}
|
|
142
161
|
|
|
143
|
-
"over
|
|
162
|
+
test("over - errors if there is only one value on the stack") {
|
|
144
163
|
pending
|
|
145
|
-
forth.eval("over")
|
|
146
|
-
case Right(state) => fail("over on empty stack should return error")
|
|
147
|
-
case Left(error) => error should equal(ForthError.StackUnderflow)
|
|
148
|
-
}
|
|
164
|
+
forth.eval("1 over").isLeft should be (true)
|
|
149
165
|
}
|
|
150
166
|
|
|
151
|
-
"
|
|
167
|
+
test("user-defined words - can consist of built-in words") {
|
|
152
168
|
pending
|
|
153
|
-
forth.eval("1
|
|
154
|
-
case Right(state) => fail("over on single item stack should return error")
|
|
155
|
-
case Left(error) => error should equal(ForthError.StackUnderflow)
|
|
156
|
-
}
|
|
169
|
+
forth.eval(": dup-twice dup dup ; 1 dup-twice").fold(_ => "", _.toString) should be ("1 1 1")
|
|
157
170
|
}
|
|
158
171
|
|
|
159
|
-
"
|
|
172
|
+
test("user-defined words - execute in the right order") {
|
|
160
173
|
pending
|
|
161
|
-
forth.eval(":
|
|
162
|
-
case Right(state) => state.toString should equal("1 1 1")
|
|
163
|
-
case Left(error) => fail("error handling define new word and use - " + error)
|
|
164
|
-
}
|
|
174
|
+
forth.eval(": countup 1 2 3 ; countup").fold(_ => "", _.toString) should be ("1 2 3")
|
|
165
175
|
}
|
|
166
176
|
|
|
167
|
-
"
|
|
177
|
+
test("user-defined words - can override other user-defined words") {
|
|
168
178
|
pending
|
|
169
|
-
forth.eval(": foo dup
|
|
170
|
-
case Right(state) => state.toString should equal("1 1 1")
|
|
171
|
-
case Left(error) => fail("error handling redefine word and use - " + error)
|
|
172
|
-
}
|
|
179
|
+
forth.eval(": foo dup ; : foo dup dup ; 1 foo").fold(_ => "", _.toString) should be ("1 1 1")
|
|
173
180
|
}
|
|
174
181
|
|
|
175
|
-
"
|
|
182
|
+
test("user-defined words - can override built-in words") {
|
|
176
183
|
pending
|
|
177
|
-
forth.eval(": swap dup
|
|
178
|
-
case Right(state) => state.toString should equal("1 1")
|
|
179
|
-
case Left(error) => fail("error handling redefining built in word and use - " + error)
|
|
180
|
-
}
|
|
184
|
+
forth.eval(": swap dup ; 1 swap").fold(_ => "", _.toString) should be ("1 1")
|
|
181
185
|
}
|
|
182
186
|
|
|
183
|
-
"
|
|
187
|
+
test("user-defined words - can override built-in operators") {
|
|
184
188
|
pending
|
|
185
|
-
forth.eval(":
|
|
186
|
-
case Right(state) => state.toString should equal("220371")
|
|
187
|
-
case Left(error) => fail("error handling word definition with odd chars - " + error)
|
|
188
|
-
}
|
|
189
|
+
forth.eval(": + * ; 3 4 +").fold(_ => "", _.toString) should be ("12")
|
|
189
190
|
}
|
|
190
191
|
|
|
191
|
-
"
|
|
192
|
+
test("user-defined words - cannot redefine numbers") {
|
|
192
193
|
pending
|
|
193
|
-
forth.eval(": 1 2 ;")
|
|
194
|
-
case Right(state) => fail("defining a new word using a number should result in an error")
|
|
195
|
-
case Left(error) => error should equal(ForthError.InvalidWord)
|
|
196
|
-
}
|
|
194
|
+
forth.eval(": 1 2 ;").isLeft should be (true)
|
|
197
195
|
}
|
|
198
196
|
|
|
199
|
-
"
|
|
197
|
+
test("user-defined words - errors if executing a non-existent word") {
|
|
200
198
|
pending
|
|
201
|
-
forth.eval("
|
|
202
|
-
case Right(state) => fail("calling a non-existent word should result in an error")
|
|
203
|
-
case Left(error) => error should equal(ForthError.InvalidWord)
|
|
204
|
-
}
|
|
199
|
+
forth.eval("foo").isLeft should be (true)
|
|
205
200
|
}
|
|
206
|
-
}
|
|
201
|
+
}
|
|
@@ -7,7 +7,7 @@ class Garden(children: List[String], plantsStr: String) {
|
|
|
7
7
|
private val sortedChildren = children.sorted
|
|
8
8
|
private val gardenMap = sortedChildren.zip(childPlants).toMap
|
|
9
9
|
|
|
10
|
-
def
|
|
10
|
+
def plants(child: String): List[Plant] = {
|
|
11
11
|
val plantChars = gardenMap.getOrElse(child, "")
|
|
12
12
|
plantChars.map(c => Plant.withName(c.toString)).toList
|
|
13
13
|
}
|
|
@@ -1,71 +1,96 @@
|
|
|
1
1
|
import org.scalatest.{Matchers, FunSuite}
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/** @version 1.0.0 */
|
|
4
|
+
class KindergartenGardenTest extends FunSuite with Matchers {
|
|
5
|
+
|
|
6
|
+
test("partial garden - garden with single student") {
|
|
7
|
+
Garden.defaultGarden("RC\nGG").plants("Alice") should be(
|
|
8
|
+
List(Plant.Radishes, Plant.Clover, Plant.Grass, Plant.Grass))
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
test("partial garden - different garden with single student") {
|
|
12
|
+
pending
|
|
13
|
+
Garden.defaultGarden("VC\nRC").plants("Alice") should be(
|
|
14
|
+
List(Plant.Violets, Plant.Clover, Plant.Radishes, Plant.Clover))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
test("partial garden - garden with two students") {
|
|
18
|
+
pending
|
|
19
|
+
Garden.defaultGarden("VVCG\nVVRC").plants("Bob") should be(
|
|
20
|
+
List(Plant.Clover, Plant.Grass, Plant.Radishes, Plant.Clover))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
test(
|
|
24
|
+
"multiple students for the same garden with three students, partial garden - second student's garden") {
|
|
25
|
+
pending
|
|
26
|
+
Garden.defaultGarden("VVCCGG\nVVCCGG").plants("Bob") should be(
|
|
27
|
+
List(Plant.Clover, Plant.Clover, Plant.Clover, Plant.Clover))
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
test(
|
|
31
|
+
"multiple students for the same garden with three students, partial garden - third student's garden") {
|
|
32
|
+
pending
|
|
33
|
+
Garden.defaultGarden("VVCCGG\nVVCCGG").plants("Charlie") should be(
|
|
34
|
+
List(Plant.Grass, Plant.Grass, Plant.Grass, Plant.Grass))
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
test("full garden - first student's garden") {
|
|
38
|
+
pending
|
|
39
|
+
Garden
|
|
40
|
+
.defaultGarden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
|
|
41
|
+
.plants("Alice") should be(
|
|
42
|
+
List(Plant.Violets, Plant.Radishes, Plant.Violets, Plant.Radishes))
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
test("full garden - second student's garden") {
|
|
46
|
+
pending
|
|
47
|
+
Garden
|
|
48
|
+
.defaultGarden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
|
|
49
|
+
.plants("Bob") should be(
|
|
50
|
+
List(Plant.Clover, Plant.Grass, Plant.Clover, Plant.Clover))
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
test("full garden - second to last student's garden") {
|
|
54
|
+
pending
|
|
55
|
+
Garden
|
|
56
|
+
.defaultGarden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
|
|
57
|
+
.plants("Kincaid") should be(
|
|
58
|
+
List(Plant.Grass, Plant.Clover, Plant.Clover, Plant.Grass))
|
|
7
59
|
}
|
|
8
60
|
|
|
9
|
-
test("
|
|
61
|
+
test("full garden - last student's garden") {
|
|
10
62
|
pending
|
|
11
|
-
Garden
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
63
|
+
Garden
|
|
64
|
+
.defaultGarden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
|
|
65
|
+
.plants("Larry") should be(
|
|
66
|
+
List(Plant.Grass, Plant.Violets, Plant.Clover, Plant.Violets))
|
|
15
67
|
}
|
|
16
68
|
|
|
17
|
-
test("
|
|
69
|
+
test("non-alphabetical student list - first student's garden") {
|
|
18
70
|
pending
|
|
19
|
-
Garden
|
|
20
|
-
|
|
71
|
+
Garden(List("Samantha", "Patricia", "Xander", "Roger"),
|
|
72
|
+
"VCRRGVRG\nRVGCCGCV").plants("Patricia") should be(
|
|
73
|
+
List(Plant.Violets, Plant.Clover, Plant.Radishes, Plant.Violets))
|
|
21
74
|
}
|
|
22
75
|
|
|
23
|
-
test("
|
|
76
|
+
test("non-alphabetical student list - second student's garden") {
|
|
24
77
|
pending
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
garden.getPlants("Charlie") should
|
|
29
|
-
equal(List(Plant.Grass, Plant.Grass, Plant.Grass, Plant.Grass))
|
|
78
|
+
Garden(List("Samantha", "Patricia", "Xander", "Roger"),
|
|
79
|
+
"VCRRGVRG\nRVGCCGCV").plants("Roger") should be(
|
|
80
|
+
List(Plant.Radishes, Plant.Radishes, Plant.Grass, Plant.Clover))
|
|
30
81
|
}
|
|
31
82
|
|
|
32
|
-
test("
|
|
83
|
+
test("non-alphabetical student list - third student's garden") {
|
|
33
84
|
pending
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
garden.getPlants("Bob") should
|
|
38
|
-
equal(List(Plant.Clover, Plant.Grass, Plant.Clover, Plant.Clover))
|
|
39
|
-
garden.getPlants("David") should
|
|
40
|
-
equal(List(Plant.Radishes, Plant.Violets, Plant.Clover, Plant.Radishes))
|
|
41
|
-
garden.getPlants("Eve") should
|
|
42
|
-
equal(List(Plant.Clover, Plant.Grass, Plant.Radishes, Plant.Grass))
|
|
43
|
-
garden.getPlants("Fred") should
|
|
44
|
-
equal(List(Plant.Grass, Plant.Clover, Plant.Violets, Plant.Clover))
|
|
45
|
-
garden.getPlants("Ginny") should
|
|
46
|
-
equal(List(Plant.Clover, Plant.Grass, Plant.Grass, Plant.Clover))
|
|
47
|
-
garden.getPlants("Harriet") should
|
|
48
|
-
equal(List(Plant.Violets, Plant.Radishes, Plant.Radishes, Plant.Violets))
|
|
49
|
-
garden.getPlants("Ileana") should
|
|
50
|
-
equal(List(Plant.Grass, Plant.Clover, Plant.Violets, Plant.Clover))
|
|
51
|
-
garden.getPlants("Joseph") should
|
|
52
|
-
equal(List(Plant.Violets, Plant.Clover, Plant.Violets, Plant.Grass))
|
|
53
|
-
garden.getPlants("Kincaid") should
|
|
54
|
-
equal(List(Plant.Grass, Plant.Clover, Plant.Clover, Plant.Grass))
|
|
55
|
-
garden.getPlants("Larry") should
|
|
56
|
-
equal(List(Plant.Grass, Plant.Violets, Plant.Clover, Plant.Violets))
|
|
85
|
+
Garden(List("Samantha", "Patricia", "Xander", "Roger"),
|
|
86
|
+
"VCRRGVRG\nRVGCCGCV").plants("Samantha") should be(
|
|
87
|
+
List(Plant.Grass, Plant.Violets, Plant.Clover, Plant.Grass))
|
|
57
88
|
}
|
|
58
89
|
|
|
59
|
-
test("
|
|
90
|
+
test("non-alphabetical student list - fourth (last) student's garden") {
|
|
60
91
|
pending
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
garden.getPlants("Roger") should
|
|
65
|
-
equal(List(Plant.Radishes, Plant.Radishes, Plant.Grass, Plant.Clover))
|
|
66
|
-
garden.getPlants("Samantha") should
|
|
67
|
-
equal(List(Plant.Grass, Plant.Violets, Plant.Clover, Plant.Grass))
|
|
68
|
-
garden.getPlants("Xander") should
|
|
69
|
-
equal(List(Plant.Radishes, Plant.Grass, Plant.Clover, Plant.Violets))
|
|
92
|
+
Garden(List("Samantha", "Patricia", "Xander", "Roger"),
|
|
93
|
+
"VCRRGVRG\nRVGCCGCV").plants("Xander") should be(
|
|
94
|
+
List(Plant.Radishes, Plant.Grass, Plant.Clover, Plant.Violets))
|
|
70
95
|
}
|
|
71
96
|
}
|