]> fbox.kageds.com Git - adventofcode.git/blob - 2022/go/day11/day11_test.go
Day_1
[adventofcode.git] / 2022 / go / day11 / day11_test.go
1 package day11
2
3 import (
4 "testing"
5
6 "github.com/stretchr/testify/require"
7 )
8
9 func TestPart1(t *testing.T) {
10 r := Part1(
11 `Monkey 0:
12 Starting items: 79, 98
13 Operation: new = old * 19
14 Test: divisible by 23
15 If true: throw to monkey 2
16 If false: throw to monkey 3
17
18 Monkey 1:
19 Starting items: 54, 65, 75, 74
20 Operation: new = old + 6
21 Test: divisible by 19
22 If true: throw to monkey 2
23 If false: throw to monkey 0
24
25 Monkey 2:
26 Starting items: 79, 60, 97
27 Operation: new = old * old
28 Test: divisible by 13
29 If true: throw to monkey 1
30 If false: throw to monkey 3
31
32 Monkey 3:
33 Starting items: 74
34 Operation: new = old + 3
35 Test: divisible by 17
36 If true: throw to monkey 0
37 If false: throw to monkey 1
38 `)
39 require.Equal(t, 10605, r)
40 }
41
42 func TestPart2(t *testing.T) {
43 r := Part2("")
44 require.Equal(t, 0, r)
45 }