Skip to content

Commit

Permalink
SeaQLgh-516: reorder the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alphavector committed Apr 27, 2023
1 parent 2e24c0c commit 0c79402
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions tests/mysql/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1295,32 +1295,6 @@ fn insert_on_conflict_4() {
);
}

#[test]
fn insert_coalesce() {
assert_eq!(Query::insert()
.into_table(Glyph::Table)
.columns([Glyph::Image, Glyph::Aspect])
.values_panic([
"04108048005887010020060000204E0180400400".into(),
Func::coalesce([Query::select()
.from(Glyph::Table)
.expr(Func::max(Expr::col(Glyph::Aspect)))
.take()
.into_sub_query_expr(),
1.into(),
Value::Bool(None).into(),
])
.into(),
])
.to_string(MysqlQueryBuilder),
[
r#"INSERT INTO `glyph` (`image`, `aspect`)"#,
r#"VALUES ('04108048005887010020060000204E0180400400', COALESCE((SELECT MAX(`aspect`) FROM `glyph`), 1, NULL))"#,
]
.join(" ")
);
}

#[test]
#[allow(clippy::approx_constant)]
fn insert_on_conflict_5() {
Expand Down Expand Up @@ -1375,6 +1349,32 @@ fn insert_on_conflict_6() {
);
}

#[test]
fn insert_coalesce() {
assert_eq!(Query::insert()
.into_table(Glyph::Table)
.columns([Glyph::Image, Glyph::Aspect])
.values_panic([
"04108048005887010020060000204E0180400400".into(),
Func::coalesce([Query::select()
.from(Glyph::Table)
.expr(Func::max(Expr::col(Glyph::Aspect)))
.take()
.into_sub_query_expr(),
1.into(),
Value::Bool(None).into(),
])
.into(),
])
.to_string(MysqlQueryBuilder),
[
r#"INSERT INTO `glyph` (`image`, `aspect`)"#,
r#"VALUES ('04108048005887010020060000204E0180400400', COALESCE((SELECT MAX(`aspect`) FROM `glyph`), 1, NULL))"#,
]
.join(" ")
);
}

#[test]
fn update_1() {
assert_eq!(
Expand Down

0 comments on commit 0c79402

Please sign in to comment.