Skip to content

Commit ad6648d

Browse files
committed
tests
1 parent 3014ad6 commit ad6648d

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

testing/go/schemas_test.go

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,11 +869,40 @@ var SchemaTests = []ScriptTest{
869869
},
870870
},
871871
},
872+
{
873+
Name: "drop schema",
874+
Focus: true,
875+
SetUpScript: []string{
876+
"CREATE SCHEMA dropme",
877+
"CREATE schema hasTables",
878+
"CREATE TABLE hasTables.t1 (pk BIGINT PRIMARY KEY, v1 BIGINT);",
879+
},
880+
Assertions: []ScriptTestAssertion{
881+
{
882+
Query: "Show schemas",
883+
Expected: []sql.Row{
884+
{"dolt"},
885+
{"dropme"},
886+
{"hasTables"},
887+
{"pg_catalog"},
888+
{"public"},
889+
{"information_schema"},
890+
},
891+
},
892+
{
893+
Query: "DROP SCHEMA dropme;",
894+
Expected: []sql.Row{},
895+
},
896+
{
897+
Query: "DROP SCHEMA dropme;",
898+
ExpectedErr: "schema dropme does not exist",
899+
},
900+
},
901+
},
872902
// More tests:
873903
// * alter table statements, when they work better
874904
// * AS OF (when supported)
875905
// * revision qualifiers
876-
// * drop schema
877906
// * more statement types
878907
// * INSERT INTO schema1 SELECT FROM schema2
879908
// * Subqueries accessing different schemas in the same SELECT

0 commit comments

Comments
 (0)