Move the rest of tests not specific to PG from the sqlparser_postgres.rs

This commit is contained in:
Nickolay Ponomarev 2019-05-03 02:42:18 +03:00
parent 478dbe940d
commit 1347ca0825
3 changed files with 33 additions and 28 deletions

View file

@ -3,7 +3,7 @@
use matches::assert_matches;
use sqlparser::sqlast::*;
use sqlparser::sqlparser::ParserError;
use sqlparser::sqlparser::*;
use sqlparser::test_utils::{all_dialects, expr_from_projection, only};
#[test]
@ -58,6 +58,18 @@ fn parse_insert_invalid() {
);
}
#[test]
fn parse_invalid_table_name() {
let ast = all_dialects().run_parser_method("db.public..customer", Parser::parse_object_name);
assert!(ast.is_err());
}
#[test]
fn parse_no_table_name() {
let ast = all_dialects().run_parser_method("", Parser::parse_object_name);
assert!(ast.is_err());
}
#[test]
fn parse_delete_statement() {
let sql = "DELETE FROM \"table\"";