(c *C)
| 54 | } |
| 55 | |
| 56 | func (*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 | |
| 84 | func (*SqlParseSuite) TestIntentionallyBadStatements(c *C) { |
| 85 | for _, test := range intentionallyBad { |
nothing calls this directly
no test coverage detected