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.
34 lines
607 B
Go
34 lines
607 B
Go
package day24
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitea.paas.celticinfo.fr/oabrivard/aoc2023/utils"
|
|
)
|
|
|
|
func TestPart1(t *testing.T) {
|
|
lines := []string{
|
|
"19, 13, 30 @ -2, 1, -2",
|
|
"18, 19, 22 @ -1, -1, -2",
|
|
"20, 25, 34 @ -2, -2, -4",
|
|
"12, 31, 28 @ -1, -2, -1",
|
|
"20, 19, 15 @ 1, -5, -3",
|
|
}
|
|
|
|
result := Part1(lines, 7.0, 27.0)
|
|
|
|
if result != 2 {
|
|
t.Fatalf("expected 2, got %d", result)
|
|
}
|
|
}
|
|
|
|
func TestPart1WithInput(t *testing.T) {
|
|
lines := utils.ReadLines("input.txt")
|
|
|
|
result := Part1(lines, 200000000000000.0, 400000000000000.0)
|
|
|
|
if result != 21785 {
|
|
t.Fatalf("expected 21785, got %d", result)
|
|
}
|
|
}
|