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.
58 lines
977 B
Go
58 lines
977 B
Go
package day7
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitea.paas.celticinfo.fr/oabrivard/aoc2023/utils"
|
|
)
|
|
|
|
func TestEvalHands(t *testing.T) {
|
|
lines := []string{
|
|
"32T3K 765",
|
|
"T55J5 684",
|
|
"KK677 28",
|
|
"KTJJT 220",
|
|
"QQQJA 483",
|
|
}
|
|
|
|
result := EvalHands(lines)
|
|
|
|
if result != 6440 {
|
|
t.Fatalf("expected 6440, got %v", result)
|
|
}
|
|
}
|
|
|
|
func TestEvalHandsWithInput(t *testing.T) {
|
|
lines := utils.ReadLines("input.txt")
|
|
result := EvalHands(lines)
|
|
|
|
if result != 251029473 {
|
|
t.Fatalf("expected 251029473, got %d", result)
|
|
}
|
|
}
|
|
|
|
func TestEvalHandsWithJoker(t *testing.T) {
|
|
lines := []string{
|
|
"32T3K 765",
|
|
"T55J5 684",
|
|
"KK677 28",
|
|
"KTJJT 220",
|
|
"QQQJA 483",
|
|
}
|
|
|
|
result := EvalHandsWithJoker(lines)
|
|
|
|
if result != 5905 {
|
|
t.Fatalf("expected 5905, got %v", result)
|
|
}
|
|
}
|
|
|
|
func TestEvalHandsWithJokerWithInput(t *testing.T) {
|
|
lines := utils.ReadLines("input.txt")
|
|
result := EvalHandsWithJoker(lines)
|
|
|
|
if result != 251003917 {
|
|
t.Fatalf("expected 251003917, got %d", result)
|
|
}
|
|
}
|