-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay09Test.groovy
36 lines (28 loc) · 996 Bytes
/
Day09Test.groovy
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
package be.vreijsenj.aoc.days
import spock.lang.Specification
class Day09Test extends Specification {
def "returns the next extrapolated value for each history trend"() {
given: "an oasis report"
def input = [
"0 3 6 9 12 15",
"1 3 6 10 15 21",
"10 13 16 21 30 45",
]
when: "the predicted values are calculated"
def result = new Day09().runPartOne(input)
then: "the result matches the example answer"
result == 114
}
def "returns the previous extrapolated value for each history trend"() {
given: "an oasis report"
def input = [
"0 3 6 9 12 15",
"1 3 6 10 15 21",
"10 13 16 21 30 45",
]
when: "the predicted values are calculated"
def result = new Day09().runPartTwo(input)
then: "the result matches the example answer"
result == 2
}
}