2017-day14: knot hash, num islands, disk defrag :)

This commit is contained in:
alexchao26
2020-12-16 18:11:34 -05:00
parent 094477ef63
commit adb8381b85
2 changed files with 209 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package main
import (
"testing"
"github.com/alexchao26/advent-of-code-go/util"
)
func Test_diskDefrag(t *testing.T) {
tests := []struct {
name string
input string
part int
want int
}{
{"example_part1", "flqrgnkx", 1, 8108},
{"actual_part1", util.ReadFile("input.txt"), 1, 8204},
{"example_part2", "flqrgnkx", 2, 1242},
// {"actual_part2", util.ReadFile("input.txt"), 2, 1089},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := diskDefrag(tt.input, tt.part); got != tt.want {
t.Errorf("diskDefrag() = %v, want %v", got, tt.want)
}
})
}
}