mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-05-18 19:13:27 +02:00
1e2a250acd
2017-day10 weird fake hashing, xor and hexadecimals
30 lines
662 B
Go
30 lines
662 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/alexchao26/advent-of-code-go/util"
|
|
)
|
|
|
|
func Test_rambunctiousRecitation(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
input string
|
|
desiredStep int
|
|
want int
|
|
}{
|
|
{"actual", util.ReadFile("input.txt"), 2020, 1259},
|
|
{"actual", util.ReadFile("input.txt"), 30000000, 689},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
startTime := time.Now()
|
|
if got := rambunctiousRecitation(tt.input, tt.desiredStep); got != tt.want {
|
|
t.Errorf("rambunctiousRecitation() = %v, want %v", got, tt.want)
|
|
}
|
|
t.Log("Op time: ", time.Since(startTime))
|
|
})
|
|
}
|
|
}
|