Skip to content

Commit

Permalink
Add clarifying comments
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Jul 23, 2021
1 parent 724bd6d commit 491dae0
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1108,11 +1108,21 @@ public void testCreateSchema()
}
assertThat(computeActual("SHOW SCHEMAS").getOnlyColumnAsSet()).doesNotContain(schemaName);
assertUpdate("CREATE SCHEMA " + schemaName);

// verify listing of new schema
assertThat(computeActual("SHOW SCHEMAS").getOnlyColumnAsSet()).contains(schemaName);

// verify SHOW CREATE SCHEMA works
assertThat((String) computeScalar("SHOW CREATE SCHEMA " + schemaName))
.startsWith(format("CREATE SCHEMA %s.%s", getSession().getCatalog().orElseThrow(), schemaName));

// try to create duplicate schema
assertQueryFails("CREATE SCHEMA " + schemaName, format("line 1:1: Schema '.*\\.%s' already exists", schemaName));

// cleanup
assertUpdate("DROP SCHEMA " + schemaName);

// verify DROP SCHEMA for non-existing schema
assertQueryFails("DROP SCHEMA " + schemaName, format("line 1:1: Schema '.*\\.%s' does not exist", schemaName));
}

Expand Down

0 comments on commit 491dae0

Please sign in to comment.