This commit is contained in:
Gareth
2024-12-03 11:15:43 +00:00
parent 8f4649e0aa
commit f6f5a10270
4 changed files with 76 additions and 4 deletions

View File

@@ -0,0 +1,17 @@
package day03
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestPart1(t *testing.T) {
r := Part1(`xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))`)
assert.Equal(t, 161, r)
}
func TestPart2(t *testing.T) {
r := Part2(`xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))`)
assert.Equal(t, 48, r)
}