(t *testing.T)
| 310 | } |
| 311 | |
| 312 | func TestLexCommentTypes(t *testing.T) { |
| 313 | verifyTokens(t, `--hello |
| 314 | -- multiple single -- / # line comments w /* more */ |
| 315 | SELECT x FROM mytable`, |
| 316 | []Token{ |
| 317 | tv(TokenCommentSingleLine, "--"), |
| 318 | tv(TokenComment, "hello"), |
| 319 | tv(TokenCommentSingleLine, "--"), |
| 320 | tv(TokenComment, " multiple single -- / # line comments w /* more */"), |
| 321 | tv(TokenSelect, "SELECT"), |
| 322 | tv(TokenIdentity, "x"), |
| 323 | tv(TokenFrom, "FROM"), |
| 324 | tv(TokenIdentity, "mytable"), |
| 325 | }) |
| 326 | |
| 327 | verifyTokens(t, `// hello |
| 328 | -- multiple single line comments |
| 329 | # with hash |
| 330 | SELECT x FROM mytable`, |
| 331 | []Token{ |
| 332 | tv(TokenCommentSlashes, "//"), |
| 333 | tv(TokenComment, " hello"), |
| 334 | tv(TokenCommentSingleLine, "--"), |
| 335 | tv(TokenComment, " multiple single line comments"), |
| 336 | tv(TokenCommentHash, "#"), |
| 337 | tv(TokenComment, " with hash"), |
| 338 | tv(TokenSelect, "SELECT"), |
| 339 | tv(TokenIdentity, "x"), |
| 340 | tv(TokenFrom, "FROM"), |
| 341 | tv(TokenIdentity, "mytable"), |
| 342 | }) |
| 343 | |
| 344 | verifyTokens(t, `/* |
| 345 | hello |
| 346 | multiline |
| 347 | */ |
| 348 | /* and more */ |
| 349 | SELECT x FROM mytable`, |
| 350 | []Token{ |
| 351 | tv(TokenCommentML, "\nhello\nmultiline\n"), |
| 352 | tv(TokenCommentML, " and more "), |
| 353 | tv(TokenSelect, "SELECT"), |
| 354 | tv(TokenIdentity, "x"), |
| 355 | tv(TokenFrom, "FROM"), |
| 356 | tv(TokenIdentity, "mytable"), |
| 357 | }) |
| 358 | } |
| 359 | |
| 360 | func TestLexSqlIdentities(t *testing.T) { |
| 361 | // http://stackoverflow.com/questions/1992314/what-is-the-difference-between-single-and-double-quotes-in-sql |
nothing calls this directly
no test coverage detected