(c *C)
| 15 | var _ = Suite(&SqlParseSuite{}) |
| 16 | |
| 17 | func (*SqlParseSuite) TestSemicolons(c *C) { |
| 18 | type testData struct { |
| 19 | line string |
| 20 | result bool |
| 21 | } |
| 22 | |
| 23 | tests := []testData{ |
| 24 | { |
| 25 | line: "END;", |
| 26 | result: true, |
| 27 | }, |
| 28 | { |
| 29 | line: "END; -- comment", |
| 30 | result: true, |
| 31 | }, |
| 32 | { |
| 33 | line: "END ; -- comment", |
| 34 | result: true, |
| 35 | }, |
| 36 | { |
| 37 | line: "END -- comment", |
| 38 | result: false, |
| 39 | }, |
| 40 | { |
| 41 | line: "END -- comment ;", |
| 42 | result: false, |
| 43 | }, |
| 44 | { |
| 45 | line: "END \" ; \" -- comment", |
| 46 | result: false, |
| 47 | }, |
| 48 | } |
| 49 | |
| 50 | for _, test := range tests { |
| 51 | r := endsWithSemicolon(test.line) |
| 52 | c.Assert(r, Equals, test.result) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | func (*SqlParseSuite) TestSplitStatements(c *C) { |
| 57 | type testData struct { |
nothing calls this directly
no test coverage detected