Day03
This commit is contained in:
17
2024/gareth/day03/day03_test.go
Normal file
17
2024/gareth/day03/day03_test.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user