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.

66 lines
1.1 KiB
Go

package day22
import (
"testing"
"gitea.paas.celticinfo.fr/oabrivard/aoc2023/utils"
)
func TestPart1(t *testing.T) {
lines := []string{
"1,0,1~1,2,1", // 1
"0,0,2~2,0,2", // 2
"0,2,3~2,2,3", // 3
"0,0,4~0,2,4", // 4
"2,0,5~2,2,5", // 5
"0,1,6~2,1,6", // 6
"1,1,8~1,1,9", // 7
}
result, _ := Part1(lines)
//result := process(lines)
if result != 5 {
t.Fatalf("expected 5, got %d", result)
}
}
func TestPart1WithInput(t *testing.T) {
lines := utils.ReadLines("input.txt")
result, _ := Part1(lines)
//result := process(lines)
if result != 428 {
t.Fatalf("expected 428, got %d", result)
}
}
func TestPart2(t *testing.T) {
lines := []string{
"1,0,1~1,2,1", // 1
"0,0,2~2,0,2", // 2
"0,2,3~2,2,3", // 3
"0,0,4~0,2,4", // 4
"2,0,5~2,2,5", // 5
"0,1,6~2,1,6", // 6
"1,1,8~1,1,9", // 7
}
result := Part2(lines)
if result != 7 {
t.Fatalf("expected 7, got %d", result)
}
}
func TestPart2WithInput(t *testing.T) {
lines := utils.ReadLines("input.txt")
result := Part2(lines)
if result != 35654 {
t.Fatalf("expected 35654, got %d", result)
}
}