Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix and unit test #266

Merged
merged 4 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/cmd/dolt/commands/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func Sql(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEn
if err != nil {
return HandleVErrAndExitCode(errhand.VerboseErrorFromError(err), usage)
}
err = runShell(ctx, se, nil)
err = runShell(ctx, se, dEnv)
if err != nil {
return HandleVErrAndExitCode(errhand.BuildDError("unable to start shell").AddCause(err).Build(), usage)
}
Expand Down
13 changes: 13 additions & 0 deletions go/cmd/dolt/commands/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ import (

var tableName = "people"

// Smoke test: Console opens and exits
func TestSqlConsole(t *testing.T) {
t.Run("SQL console opens and exits", func(t *testing.T) {
dEnv := createEnvWithSeedData(t)
args := []string{}
commandStr := "dolt sql"

result := Sql(context.TODO(), commandStr, args, dEnv)
assert.Equal(t, 0, result)
})

}

// Smoke tests, values are printed to console
func TestSqlSelect(t *testing.T) {
tests := []struct {
Expand Down