mirror of
https://github.com/Crocmagnon/advent-of-code.git
synced 2024-11-14 10:43:58 +01:00
18 lines
362 B
Go
18 lines
362 B
Go
package _023
|
|
|
|
import (
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func check(test testCase, fn solveFunc) func(t *testing.T) {
|
|
return func(t *testing.T) {
|
|
file, err := os.Open(test.filename)
|
|
require.NoError(t, err)
|
|
got, err := fn(file)
|
|
require.NoError(t, err)
|
|
assert.Equal(t, test.want, got)
|
|
}
|
|
}
|