2021 day 13,15,16. need to clean up this code quite a bit

This commit is contained in:
alexchao26
2021-12-18 12:22:42 -05:00
parent d9f24da95a
commit 84647b8a94
6 changed files with 796 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
package main
import (
"testing"
)
var example = `6,10
0,14
9,10
0,3
10,4
4,11
6,0
6,12
4,1
0,13
10,12
3,4
3,0
8,4
1,10
2,14
8,10
9,0
fold along y=7
fold along x=5`
func Test_part1(t *testing.T) {
tests := []struct {
name string
input string
want int
}{
{
name: "example",
input: example,
want: 17,
},
// {
// name: "actual",
// input: input,
// want: 0,
// },
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := part1(tt.input); got != tt.want {
t.Errorf("part1() = %v, want %v", got, tt.want)
}
})
}
}
func Test_part2(t *testing.T) {
tests := []struct {
name string
input string
want int
}{
{
name: "example",
input: example,
want: 0,
},
// {
// name: "actual",
// input: input,
// want: 0,
// },
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := part2(tt.input); got != tt.want {
t.Errorf("part2() = %v, want %v", got, tt.want)
}
})
}
}