formatting
This commit is contained in:
parent
ad98cfafb2
commit
c25c6edc6a
29 changed files with 886 additions and 571 deletions
|
|
@ -77,8 +77,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_parse_create_no_quotes_table_name() {
|
||||
parse_create("CREATE TABLE Table1(id UUID PRIMARY KEY,column1 INT)")
|
||||
.expect("should parse");
|
||||
parse_create("CREATE TABLE Table1(id UUID PRIMARY KEY,column1 INT)").expect("should parse");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -91,8 +90,8 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_parse_create() {
|
||||
let (_, create) = parse_create("CREATE TABLE \"Table1\"( id UUID , column1 INT )")
|
||||
.expect("should parse");
|
||||
let (_, create) =
|
||||
parse_create("CREATE TABLE \"Table1\"( id UUID , column1 INT )").expect("should parse");
|
||||
assert!(matches!(create, RawQuerySyntax::CreateTable(_)));
|
||||
match create {
|
||||
RawQuerySyntax::CreateTable(schema) => {
|
||||
|
|
@ -114,11 +113,13 @@ mod tests {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_parse_create_option() {
|
||||
let (_, create) = parse_create("CREATE TABLE games (id UUID PRIMARY KEY, name STRING, year Option(INT), price NUMBER)")
|
||||
.expect("should parse");
|
||||
let (_, create) = parse_create(
|
||||
"CREATE TABLE games (id UUID PRIMARY KEY, name STRING, year Option(INT), price NUMBER)",
|
||||
)
|
||||
.expect("should parse");
|
||||
assert!(matches!(create, RawQuerySyntax::CreateTable(_)));
|
||||
match create {
|
||||
RawQuerySyntax::CreateTable(schema) => {
|
||||
|
|
@ -139,16 +140,12 @@ mod tests {
|
|||
assert_eq!(column1_column.type_, DbType::String);
|
||||
|
||||
let column = schema.get_column(&"year".to_string());
|
||||
let Some(column) = column else {
|
||||
panic!()
|
||||
};
|
||||
let Some(column) = column else { panic!() };
|
||||
assert_eq!(column.column_name, "year".to_string());
|
||||
assert_eq!(column.type_, DbType::Option(Box::new(DbType::Int)));
|
||||
|
||||
let column = schema.get_column(&"price".to_string());
|
||||
let Some(column) = column else {
|
||||
panic!()
|
||||
};
|
||||
let Some(column) = column else { panic!() };
|
||||
assert_eq!(column.column_name, "price".to_string());
|
||||
assert_eq!(column.type_, DbType::Number);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue