MCPcopy
hub / github.com/rubenv/sql-migrate / TestSplitStatements

Method TestSplitStatements

sqlparse/sqlparse_test.go:56–82  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

54}
55
56func (*SqlParseSuite) TestSplitStatements(c *C) {
57 type testData struct {
58 sql string
59 upCount int
60 downCount int
61 }
62
63 tests := []testData{
64 {
65 sql: functxt,
66 upCount: 2,
67 downCount: 2,
68 },
69 {
70 sql: multitxt,
71 upCount: 2,
72 downCount: 2,
73 },
74 }
75
76 for _, test := range tests {
77 migration, err := ParseMigration(strings.NewReader(test.sql))
78 c.Assert(err, IsNil)
79 c.Assert(migration.UpStatements, HasLen, test.upCount)
80 c.Assert(migration.DownStatements, HasLen, test.downCount)
81 }
82}
83
84func (*SqlParseSuite) TestIntentionallyBadStatements(c *C) {
85 for _, test := range intentionallyBad {

Callers

nothing calls this directly

Calls 1

ParseMigrationFunction · 0.70

Tested by

no test coverage detected