You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
675 B
Go
42 lines
675 B
Go
package day25
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitea.paas.celticinfo.fr/oabrivard/aoc2023/utils"
|
|
)
|
|
|
|
func TestPart1(t *testing.T) {
|
|
lines := []string{
|
|
"jqt: rhn xhk nvd",
|
|
"rsh: frs pzl lsr",
|
|
"xhk: hfx",
|
|
"cmg: qnr nvd lhk bvb",
|
|
"rhn: xhk bvb hfx",
|
|
"bvb: xhk hfx",
|
|
"pzl: lsr hfx nvd",
|
|
"qnr: nvd",
|
|
"ntq: jqt hfx bvb xhk",
|
|
"nvd: lhk",
|
|
"lsr: lhk",
|
|
"rzs: qnr cmg lsr rsh",
|
|
"frs: qnr lhk lsr",
|
|
}
|
|
|
|
result := Part1(lines)
|
|
|
|
if result != 54 {
|
|
t.Fatalf("expected 54, got %d", result)
|
|
}
|
|
}
|
|
|
|
func TestPart1WithInput(t *testing.T) {
|
|
lines := utils.ReadLines("input.txt")
|
|
|
|
result := Part1(lines)
|
|
|
|
if result != 2402 {
|
|
t.Fatalf("expected 2402, got %d", result)
|
|
}
|
|
}
|