18 lines
369 B
Go
18 lines
369 B
Go
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)
|
|
}
|