sq/drivers/json/internal_test.go
Neil O'Toole 58ccfc9ded
Json driver; refactoring of core packages (#66)
* Type Detector refactor

* json driver impl; refactoring of source.Files reader et al

* working on kind detector

* significant switcheroo of packages

* partway throught refactoring Kind

* major package switcheroo for Kind
2020-08-23 04:42:15 -06:00

22 lines
444 B
Go

package json
import (
"context"
"os"
"testing"
"github.com/stretchr/testify/require"
"github.com/neilotoole/sq/testh/sakila"
)
func TestPredictColKindsJSONA(t *testing.T) {
f, err := os.Open("testdata/actor.jsona")
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, f.Close()) })
kinds, err := predictColKindsJSONA(context.Background(), f)
require.NoError(t, err)
require.Equal(t, sakila.TblActorColKinds(), kinds)
}