20223 day1
This commit is contained in:
28
2023/go/day01/day01_test.go
Normal file
28
2023/go/day01/day01_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package day01
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestPart1(t *testing.T) {
|
||||
r := Part1(
|
||||
`1abc2
|
||||
pqr3stu8vwx
|
||||
a1b2c3d4e5f
|
||||
treb7uchet`)
|
||||
require.Equal(t, 142, r)
|
||||
}
|
||||
|
||||
func TestPart2(t *testing.T) {
|
||||
r := Part2(
|
||||
`two1nine
|
||||
eightwothree
|
||||
abcone2threexyz
|
||||
xtwone3four
|
||||
4nineeightseven2
|
||||
zoneight234
|
||||
7pqrstsixteen`)
|
||||
require.Equal(t, 281, r)
|
||||
}
|
||||
Reference in New Issue
Block a user