mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-18 21:52:28 +03:00
58ccfc9ded
* 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
22 lines
444 B
Go
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)
|
|
}
|