This commit is contained in:
Gareth
2024-12-05 13:39:33 +00:00
parent 235999524b
commit 88938a8627
4 changed files with 1586 additions and 4 deletions

View File

@@ -0,0 +1,71 @@
package day05
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestPart1(t *testing.T) {
r := Part1(`47|53
97|13
97|61
97|47
75|29
61|13
75|53
29|13
97|29
53|29
61|53
97|53
61|29
47|13
75|47
97|75
47|61
75|61
47|29
75|13
53|13
75,47,61,53,29
97,61,53,29,13
75,29,13
75,97,47,61,53
61,13,29
97,13,75,29,47`)
assert.Equal(t, 143, r)
}
func TestPart2(t *testing.T) {
r := Part2(`47|53
97|13
97|61
97|47
75|29
61|13
75|53
29|13
97|29
53|29
61|53
97|53
61|29
47|13
75|47
97|75
47|61
75|61
47|29
75|13
53|13
75,47,61,53,29
97,61,53,29,13
75,29,13
75,97,47,61,53
61,13,29
97,13,75,29,47`)
assert.Equal(t, 123, r)
}