From 985d565ec8f59c49d545b126cef768d7fc0606fa Mon Sep 17 00:00:00 2001 From: Asdine El Hrychy Date: Mon, 27 Jun 2022 19:59:41 +0800 Subject: [PATCH] Fix tests --- cmd/genji/dbutil/dump_test.go | 2 +- cmd/genji/dbutil/exec_test.go | 2 +- cmd/genji/shell/command_test.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/genji/dbutil/dump_test.go b/cmd/genji/dbutil/dump_test.go index bac4e28b..4c5be1f2 100644 --- a/cmd/genji/dbutil/dump_test.go +++ b/cmd/genji/dbutil/dump_test.go @@ -54,7 +54,7 @@ func TestDump(t *testing.T) { writeToBuf("\n") } - q := fmt.Sprintf("CREATE TABLE %s (a INTEGER, ...);", table) + q := fmt.Sprintf("CREATE TABLE %s (a INTEGER, b ANY, c ANY, ...);", table) err = db.Exec(q) assert.NoError(t, err) writeToBuf(q + "\n") diff --git a/cmd/genji/dbutil/exec_test.go b/cmd/genji/dbutil/exec_test.go index 769acfa5..595d8bdb 100644 --- a/cmd/genji/dbutil/exec_test.go +++ b/cmd/genji/dbutil/exec_test.go @@ -19,7 +19,7 @@ func TestExecSQL(t *testing.T) { var got bytes.Buffer err = ExecSQL(context.Background(), db, strings.NewReader(` - CREATE TABLE test; + CREATE TABLE test(a, ...); CREATE INDEX idx_a ON test (a); INSERT INTO test (a, b) VALUES (1, 2), (2, 2), (3, 2); SELECT * FROM test; diff --git a/cmd/genji/shell/command_test.go b/cmd/genji/shell/command_test.go index 900d5cbf..d93717e6 100644 --- a/cmd/genji/shell/command_test.go +++ b/cmd/genji/shell/command_test.go @@ -71,10 +71,10 @@ func TestIndexesCmd(t *testing.T) { defer db.Close() err = db.Exec(` - CREATE TABLE foo; + CREATE TABLE foo(a, b); CREATE INDEX idx_foo_a ON foo (a); CREATE INDEX idx_foo_b ON foo (b); - CREATE TABLE bar; + CREATE TABLE bar(a, b); CREATE INDEX idx_bar_a_b ON bar (a, b); `) assert.NoError(t, err) @@ -101,7 +101,7 @@ func TestSaveCommand(t *testing.T) { defer db.Close() err = db.Exec(` - CREATE TABLE test (a DOUBLE, ...); + CREATE TABLE test (a DOUBLE, b, ...); CREATE INDEX idx_a_b ON test (a, b); `) assert.NoError(t, err)