(t *testing.T)
| 17 | import "testing" |
| 18 | |
| 19 | func TestCreateDatabase(t *testing.T) { |
| 20 | RunScripts(t, []ScriptTest{ |
| 21 | { |
| 22 | Name: "simple create database", |
| 23 | Assertions: []ScriptTestAssertion{ |
| 24 | { |
| 25 | Query: "CREATE DATABASE testdb", |
| 26 | }, |
| 27 | { |
| 28 | Query: "USE testdb", |
| 29 | }, |
| 30 | }, |
| 31 | }, |
| 32 | { |
| 33 | Name: "encoding", |
| 34 | Assertions: []ScriptTestAssertion{ |
| 35 | { |
| 36 | Query: "CREATE DATABASE testdb encoding=utf8", |
| 37 | }, |
| 38 | { |
| 39 | Query: "USE testdb", |
| 40 | }, |
| 41 | { |
| 42 | Query: "CREATE DATABASE testdb2 encoding=latin1", |
| 43 | }, |
| 44 | { |
| 45 | Query: "USE testdb2", |
| 46 | }, |
| 47 | { |
| 48 | Query: "CREATE DATABASE testdb3 encoding=notexist", |
| 49 | // Errors converted to warnings for now |
| 50 | }, |
| 51 | }, |
| 52 | }, |
| 53 | { |
| 54 | Name: "multiple options", |
| 55 | Assertions: []ScriptTestAssertion{ |
| 56 | { |
| 57 | Query: "CREATE DATABASE testdb OWNER=foo ENCODING=utf8", |
| 58 | }, |
| 59 | { |
| 60 | Query: "USE testdb", |
| 61 | }, |
| 62 | }, |
| 63 | }, |
| 64 | { |
| 65 | Name: "with hyphen", |
| 66 | Assertions: []ScriptTestAssertion{ |
| 67 | { |
| 68 | Query: "CREATE DATABASE \"test-db\"", |
| 69 | }, |
| 70 | { |
| 71 | Query: "USE \"test-db\"", |
| 72 | }, |
| 73 | }, |
| 74 | }, |
| 75 | }) |
| 76 | } |
nothing calls this directly
no test coverage detected