mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-18 13:41:49 +03:00
30 lines
562 B
Go
30 lines
562 B
Go
|
package cli_test
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/require"
|
||
|
|
||
|
"github.com/neilotoole/sq/cli/testrun"
|
||
|
"github.com/neilotoole/sq/testh"
|
||
|
"github.com/neilotoole/sq/testh/sakila"
|
||
|
)
|
||
|
|
||
|
func TestCmdSrc(t *testing.T) {
|
||
|
ctx := context.Background()
|
||
|
th := testh.New(t)
|
||
|
|
||
|
tr := testrun.New(ctx, t, nil).Add()
|
||
|
err := tr.Exec("src")
|
||
|
require.NoError(t, err)
|
||
|
|
||
|
tr.Reset().Add(*th.Source(sakila.CSVActor))
|
||
|
err = tr.Exec("src")
|
||
|
require.NoError(t, err)
|
||
|
|
||
|
err = tr.Reset().Exec(".data | .[0:5]")
|
||
|
require.NoError(t, err)
|
||
|
t.Log(tr.Out.String())
|
||
|
}
|